Add Node version validation and manifest fetch retry#1580
Open
v-jitenderpalsingh wants to merge 3 commits into
Open
Add Node version validation and manifest fetch retry#1580v-jitenderpalsingh wants to merge 3 commits into
v-jitenderpalsingh wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request strengthens actions/setup-node reliability by validating the Node versions manifest fetch (including retries) and adding a post-install verification step to ensure the node on PATH matches the installed toolcache version—directly addressing silent fall-through failures described in #1555/#1556.
Changes:
- Add manifest fetch retry (up to 3 attempts) and reject empty/truncated manifest responses.
- Add post-install
node --versionverification after both cache-hit installs and fresh downloads. - Update/extend Jest tests to cover the new retry/validation and verification behaviors.
Reviewed changes
Copilot reviewed 2 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/distributions/official_builds/official_builds.ts | Implements manifest retry/validation and adds post-install Node version verification. |
| tests/official-installer.test.ts | Updates mocks and adds tests for manifest retry/validation and version verification failure cases. |
| dist/cache-save/index.js | Updates bundled distribution output; currently includes an apparent @actions/cache version mismatch vs package-lock.json. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+345
to
+349
| if (actualVersion !== expectedVersion) { | ||
| throw new Error( | ||
| `Node ${expectedVersion} installation failed, likely due to an incomplete or corrupted download.` | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
This PR validates that the manifest is a non-empty list of valid releases and retries fetching the manifest on transient network errors or truncated responses (up to 3 attempts). It also adds a post-install check that verifies
node --versionmatches the expected version.Related issue:
#1555
#1556
Check list: