Skip to content

Commit dd93377

Browse files
Apply suggestions from code review
Co-authored-by: Norbert Elter <72046715+itsyoboieltr@users.noreply.github.com>
1 parent 03b551f commit dd93377

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ This TypeScript module is maintained in the style of the MetaMask team.
4242
with:
4343
is-high-risk-environment: false
4444
yarn-custom-url: 'https://your-cdn.com/yarn-4.9.1/yarn.js#sha224.abc123'
45-
yarn-install-max-retries: '7'
45+
yarn-install-max-retries: 5
4646
```
4747
4848
### Options

action.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ inputs:
2828
yarn-install-max-retries:
2929
description: 'Maximum number of retries for the `yarn --immutable` install command.'
3030
required: false
31-
default: '5'
31+
default: 5
3232
yarn-custom-url:
3333
description: 'Optional custom URL for a Yarn bundle to be prepared and activated by Corepack. For CI testing.'
3434
required: false
@@ -87,10 +87,13 @@ runs:
8787
# Prepare and activate custom Yarn if URL is provided.
8888
# This runs *before* setup-node might try to cache a standard Yarn.
8989
- name: Prepare and activate custom Yarn
90-
if: ${{ inputs.yarn-custom-url != '' }}
90+
if: ${{ env.YARN_CUSTOM_URL }}
91+
env:
92+
COREPACK_ENABLE_UNSAFE_CUSTOM_URLS: 1
93+
YARN_CUSTOM_URL: ${{ inputs.yarn-custom-url }}
9194
run: |
92-
echo "Preparing and activating custom Yarn from URL: ${{ inputs.yarn-custom-url }}"
93-
corepack prepare 'yarn@${{ inputs.yarn-custom-url }}' --activate
95+
echo "Preparing and activating custom Yarn from URL: ${YARN_CUSTOM_URL}"
96+
corepack prepare "yarn@${YARN_CUSTOM_URL}" --activate
9497
shell: bash
9598

9699
# In a low-risk environment, try to download cache of `node_modules`, if it

0 commit comments

Comments
 (0)