Conversation
Co-authored-by: Apollon77 <11976694+Apollon77@users.noreply.github.com>
Co-authored-by: Apollon77 <11976694+Apollon77@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] new repo created with minimum node.js 20 tries to run node.js 18 tests
Fix GitHub Actions workflow to respect minimum Node.js version selection
Aug 31, 2025
Apollon77
reviewed
Aug 31, 2025
| const ltsNodeVersion = "20.x"; | ||
| const adapterTestVersions = ["20.x", "22.x", "24.x"]; | ||
| // Determine the LTS version and test versions based on the minimum Node.js version selected | ||
| const minNodeVersion = answers.nodeVersion || "20"; |
Collaborator
There was a problem hiding this comment.
please add a constant for the "recommended nodejs fall back version" in a new file for such fallbacks (are there more such fallbacks in the code?) and import from there
Collaborator
There was a problem hiding this comment.
@copilot please add a constant for the "recommended nodejs fall back version" in a new file for such fallbacks (are there more such fallbacks in the code?) and import from there
Contributor
Author
There was a problem hiding this comment.
Added a new constants file src/lib/constants.ts with RECOMMENDED_NODE_VERSION_FALLBACK constant. Found and updated three locations where "20" was used as a Node.js version fallback:
templates/_github/workflows/test-and-release.yml.tstemplates/package.json.tstemplates/tsconfig.json.ts
All now import and use the centralized constant. Commit fb9ad97.
- Add RECOMMENDED_NODE_VERSION_FALLBACK constant in src/lib/constants.ts - Update templates/_github/workflows/test-and-release.yml.ts to import and use the constant - Update templates/package.json.ts to import and use the constant - Update templates/tsconfig.json.ts to import and use the constant - Fix prettier formatting issues in test file This centralizes the fallback value, making it easier to maintain and update in the future. Co-authored-by: Apollon77 <11976694+Apollon77@users.noreply.github.com>
Copilot
AI
changed the title
Fix GitHub Actions workflow to respect minimum Node.js version selection
Fix GitHub Actions workflow to respect minimum Node.js version selection and centralize version fallbacks
Aug 31, 2025
Apollon77
approved these changes
Sep 2, 2025
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.
The GitHub Actions workflow template was incorrectly using hardcoded Node.js test versions, causing CI failures when adapters were created with Node.js 20+ as the minimum version. The workflow would still attempt to run tests on Node.js 18.x, leading to npm engine compatibility errors:
Changes Made
Dynamic Node.js Version Filtering
Updated
templates/_github/workflows/test-and-release.yml.tsto dynamically filter Node.js versions based on the user's minimum version selection:Before:
After:
Centralized Version Fallbacks
Created
src/lib/constants.tsto centralize fallback values and eliminate code duplication. Updated three template files that were using hardcoded Node.js version fallbacks:templates/_github/workflows/test-and-release.yml.tstemplates/package.json.tstemplates/tsconfig.json.tsAll now import and use the
RECOMMENDED_NODE_VERSION_FALLBACKconstant, making future updates easier to maintain.Results
Now when creating adapters with different minimum Node.js versions:
[20.x, 22.x, 24.x], uses20.xfor LTS operations[22.x, 24.x], uses22.xfor LTS operations[24.x], uses24.xfor LTS operationsThis ensures CI pipelines only test against compatible Node.js versions, eliminating the engine compatibility failures while improving code maintainability.
Testing
Added comprehensive test coverage to prevent regressions, validating that the workflow correctly filters Node.js versions for all supported minimum versions (20, 22, 24).
Fixes #1144.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.