fix: Add retry mechanism for .nvmrc and yarn.lock downloads#63
Conversation
|
|
||
| - name: Remove globally installed Yarn | ||
| if: ${{ steps.try-skip-setup.outputs.cache-hit != 'true' }} | ||
| run: npm uninstall -g yarn |
There was a problem hiding this comment.
Had to add this to fix compatibility with Windows, not sure why Yarn inside MetaMask/action-retry-command breaks otherwise. PATH issue?
|
|
||
| - name: Synthesize our node version from inputs.node-version and .nvmrc | ||
| id: compute-node-version | ||
| run: | |
There was a problem hiding this comment.
Diff is a bit hard to read, but essentially the only change here is wrapping everything in MetaMask/action-retry-command.
There was a problem hiding this comment.
Pull request overview
Improves resilience of the composite GitHub Action by reducing failures from transient network errors when determining Node/Yarn state during CI setup.
Changes:
- Wrap
.nvmrcdownload + Node version computation inMetaMask/action-retry-command. - Wrap
yarn.lockdownload (used for cache-based setup skipping) inMetaMask/action-retry-command. - Add a step to uninstall globally-installed Yarn before
corepack enableon the non-cache path.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
|
|
||
| - name: Remove globally installed Yarn | ||
| if: ${{ steps.try-skip-setup.outputs.cache-hit != 'true' }} | ||
| run: npm uninstall -g yarn |
HowardBraham
left a comment
There was a problem hiding this comment.
This change is failing on metamask-extension, run here
I think we may need to update node to 24, and perhaps we should also update yarn to newest? Just make sure it works on your repos too.
Why npm uninstall -g yarn is necessary is confusing me. Could be solved with version updates?
This reverts commit 47e0d39.
2b8760c to
d907392
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit d907392. Configure here.
|
|
||
| echo "node-version=$NODE_VERSION" >> "$GITHUB_OUTPUT" | ||
| shell: bash | ||
| echo "node-version=$NODE_VERSION" >> "$GITHUB_OUTPUT" |
There was a problem hiding this comment.
Step output lost through composite action wrapping
High Severity
The compute-node-version step was changed from run: to uses: MetaMask/action-retry-command@v1. The command inside writes node-version to $GITHUB_OUTPUT, but in GitHub Actions, outputs set within a composite action's internal steps are not automatically propagated to the calling step. Unless action-retry-command explicitly declares and forwards the node-version output (which a generic retry action almost certainly does not), steps.compute-node-version.outputs.node-version will be empty everywhere it's referenced — breaking setup-node, all cache keys, and the action's own computed-node-version output.
Additional Locations (2)
Reviewed by Cursor Bugbot for commit d907392. Configure here.


Note
Medium Risk
Touches the CI environment bootstrapping path; retries are low risk, but uninstalling global Yarn and changing download behavior could affect workflows that implicitly relied on a preinstalled Yarn or on immediate download failure semantics.
Overview
Improves resiliency of the composite action by wrapping the
.nvmrcandyarn.lockdownload steps withMetaMask/action-retry-command@v1, reducing flaky failures when fetching fromraw.githubusercontent.com.Also adds a setup step to
npm uninstall -g yarnbeforecorepack enable, ensuring the action uses the Corepack-managed Yarn rather than any globally installed Yarn when setup is not skipped.Reviewed by Cursor Bugbot for commit d907392. Bugbot is set up for automated code reviews on this repo. Configure here.