Skip to content

Add Node version validation and manifest fetch retry#1580

Open
v-jitenderpalsingh wants to merge 3 commits into
actions:mainfrom
v-jitenderpalsingh:node-validate-retry
Open

Add Node version validation and manifest fetch retry#1580
v-jitenderpalsingh wants to merge 3 commits into
actions:mainfrom
v-jitenderpalsingh:node-validate-retry

Conversation

@v-jitenderpalsingh

Copy link
Copy Markdown

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 --version matches the expected version.

Related issue:
#1555
#1556

Check list:

  • Mark if documentation changes are required.
  • Mark if tests were added or updated to cover the changes.

Copilot AI review requested due to automatic review settings July 9, 2026 06:07
@v-jitenderpalsingh v-jitenderpalsingh requested a review from a team as a code owner July 9, 2026 06:07
@v-jitenderpalsingh v-jitenderpalsingh self-assigned this Jul 9, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 --version verification 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.`
);
}
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