Repository navigation
Pin @actions/github@5 in release workflow to fix Node 20 module error - #93
Conversation
Signed-off-by: Botond Szirtes <botond.szirtes@est.tech>
There was a problem hiding this comment.
Pull request overview
This PR updates the release GitHub Actions workflow to avoid Node 20 require()/package-exports failures in generate-release-notes.js by pinning @actions/github to a CommonJS-compatible major version.
Changes:
- Pin
@actions/githubinstallation in the release workflow to@actions/github@5. - Normalize indentation for the “Generate Release Notes” multiline
runstep.
💡 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.
| path: github | ||
| - name: Install node modules | ||
| run: yarn add @actions/github | ||
| run: yarn add @actions/github@5 |
There was a problem hiding this comment.
yarn add @actions/github@5 still pulls the latest v5 minor/patch at runtime, which can change over time and re-break the workflow. To make releases reproducible, consider pinning to an exact version (e.g. @actions/github@5.x.y) and updating it intentionally when needed.
| run: yarn add @actions/github@5 | |
| run: yarn add @actions/github@5.1.1 |
| ls -ltr github/scripts | ||
| node github/scripts/generate-release-notes.js '${{ secrets.token }}' '${{ needs.get-tag.outputs.tag }}' '${{ github.event.repository.name }}' > notes.txt | ||
| ls -ltr github/scripts | ||
| node github/scripts/generate-release-notes.js '${{ secrets.token }}' '${{ needs.get-tag.outputs.tag }}' '${{ github.event.repository.name }}' > notes.txt |
There was a problem hiding this comment.
The workflow passes ${{ secrets.token }} as a command-line argument to the Node script. Secrets in process args can be exposed via debug output or process inspection; prefer passing the token via an environment variable (e.g. GITHUB_TOKEN/GH_TOKEN) and having the script read it from process.env.
| node github/scripts/generate-release-notes.js '${{ secrets.token }}' '${{ needs.get-tag.outputs.tag }}' '${{ github.event.repository.name }}' > notes.txt | |
| node github/scripts/generate-release-notes.js '${{ needs.get-tag.outputs.tag }}' '${{ github.event.repository.name }}' > notes.txt | |
| env: | |
| GH_TOKEN: ${{ secrets.token }} |
The release workflow was failing with ERR_PACKAGE_PATH_NOT_EXPORTED when running
generate-release-notes.js.This happens because newer versions of
@actions/githubare ESM-only and do not supportrequire(), which our script uses. GitHub runners now use Node 20, which strictly enforces package exports.Pinning
@actions/githubtov5restoresCommonJScompatibility and fixes the release notes generation step.