mirror of
https://github.com/yanhao98/composite-actions.git
synced 2025-07-13 06:40:49 +08:00
feat: 在 action.yml 中添加对 .npmrc 文件存在性的检查,以确保正确提取 Node 版本
This commit is contained in:
@ -68,7 +68,9 @@ runs:
|
||||
|
||||
# Extract the node version from the .npmrc file
|
||||
set -x;
|
||||
nodeVersion=$(grep 'use-node-version=' .npmrc | sed -E 's/^use-node-version=([0-9.]+).*/\1/')
|
||||
if [ -f ".npmrc" ]; then
|
||||
nodeVersion=$(grep 'use-node-version=' .npmrc | sed -E 's/^use-node-version=([0-9.]+).*/\1/')
|
||||
fi
|
||||
if [ -z "$nodeVersion" ]; then
|
||||
nodeVersion="lts/*"
|
||||
fi
|
||||
|
Reference in New Issue
Block a user