mirror of
https://github.com/yanhao98/composite-actions.git
synced 2025-07-13 06:40:49 +08:00
feat: 更新 action.yml,添加对已安装 pnpm 的处理注释,并优化节点版本提取逻辑
This commit is contained in:
@ -46,6 +46,7 @@ runs:
|
|||||||
|
|
||||||
if [[ "$packageManager" == "pnpm"* ]]; then
|
if [[ "$packageManager" == "pnpm"* ]]; then
|
||||||
echo "##########################################################"
|
echo "##########################################################"
|
||||||
|
# TODO: 还有一种情况就是镜像中已经安装了pnpm。
|
||||||
echo "setup-pnpm=true"
|
echo "setup-pnpm=true"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
@ -64,7 +65,9 @@ runs:
|
|||||||
echo "pnpm-lock.yaml does not exist"
|
echo "pnpm-lock.yaml does not exist"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
# Extract the node version from the .npmrc file
|
# 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/')
|
nodeVersion=$(grep 'use-node-version=' .npmrc | sed -E 's/^use-node-version=([0-9.]+).*/\1/')
|
||||||
echo "node-version=$nodeVersion" >> $GITHUB_OUTPUT
|
echo "node-version=$nodeVersion" >> $GITHUB_OUTPUT
|
||||||
sed -i '/use-node-version/d' .npmrc
|
sed -i '/use-node-version/d' .npmrc
|
||||||
|
Reference in New Issue
Block a user