Skip to content

Pin @actions/github@5 in release workflow to fix Node 20 module error - #93

Merged
bszirtes merged 1 commit into
mainfrom
fix-release-notes-script
Mar 9, 2026
Merged

bszirtes merged 1 commit into
mainfrom
fix-release-notes-script

Conversation

@bszirtes

@bszirtes bszirtes commented Mar 9, 2026

Copy link
Copy Markdown
Contributor

The release workflow was failing with ERR_PACKAGE_PATH_NOT_EXPORTED when running generate-release-notes.js .

This happens because newer versions of @actions/github are ESM-only and do not support require(), which our script uses. GitHub runners now use Node 20, which strictly enforces package exports.

Pinning @actions/github to v5 restores CommonJS compatibility and fixes the release notes generation step.

Signed-off-by: Botond Szirtes <botond.szirtes@est.tech>
@bszirtes
bszirtes requested a review from ljkiraly March 9, 2026 09:55

@ljkiraly ljkiraly left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks OK

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 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/github installation in the release workflow to @actions/github@5.
  • Normalize indentation for the “Generate Release Notes” multiline run step.

💡 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

Copilot AI Mar 9, 2026

Copy link

Choose a reason for hiding this comment

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

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.

Suggested change
run: yarn add @actions/github@5
run: yarn add @actions/github@5.1.1

Copilot uses AI. Check for mistakes.
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

Copilot AI Mar 9, 2026

Copy link

Choose a reason for hiding this comment

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

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.

Suggested change
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 }}

Copilot uses AI. Check for mistakes.
@bszirtes
bszirtes merged commit fe8cd96 into main Mar 9, 2026
6 checks passed
@bszirtes
bszirtes deleted the fix-release-notes-script branch March 9, 2026 10:35
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.

3 participants