Skip to content

Conversation

@secustor
Copy link
Member

@secustor secustor commented Feb 17, 2025

Allows to install Yarn v4 via packageManager field in package.json

Context backstage/backstage#28881

Comment on lines +36 to +41
run: |
if [[ "${{ inputs.yarn-install-force }}" == "true" ]]; then
npm install --force -g corepack@${{ inputs.corepack-version }}
else
npm install -g corepack@${{ inputs.corepack-version }}
fi

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be simplified a bit.

Suggested change
run: |
if [[ "${{ inputs.yarn-install-force }}" == "true" ]]; then
npm install --force -g corepack@${{ inputs.corepack-version }}
else
npm install -g corepack@${{ inputs.corepack-version }}
fi
env:
YARN_INSTALL_FORCE: ${{ inputs.yarn-install-force == 'true' && '--force' || '' }}
run: |
npm install $YARN_INSTALL_FORCE -g corepack@${{ inputs.corepack-version }}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants