Conversation
…pe:module The root package.json declares "type": "module", so Node treats the .js scripts under github-actions/ as ES modules. Both use `module.exports`, which is not defined in ESM scope, so the "Add Pull Request Instructions" workflow failed with a ReferenceError on every PR opened against development. Rename both to .cjs and update the require() paths in the two workflows. No logic changes. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
What changes did you make and why did you make them ?
The Add Pull Request Instructions workflow fails on every PR opened against
development:The root
package.jsondeclares"type": "module"(re-added inf42f6fce, the ESM test-suite migration), which makes Node treat every.jsfile in the repo root tree as an ES module. The two helper scripts undergithub-actions/pr-instructions/were missed by that migration and still use CommonJSmodule.exports/require, soactions/github-script'srequire('./github-actions/...')blows up before the script runs.create-instruction.js→create-instruction.cjsandpost-comment.js→post-comment.cjs, which opts both files out oftype: moduleand back into CommonJS.require()paths in.github/workflows/pr-instructions.ymland.github/workflows/wr-pr-instructions.ymlto match.No logic changes — the rename is the entire fix.
How to test
Opening this PR exercises the workflow directly: Add Pull Request Instructions should now pass and the follow-up
workflow_runjob should post the checkout-instructions comment.Verified locally that both files load as CommonJS and produce the expected output:
Notes for reviewers
cypress/plugins/index.jsandcypress/support/index.jsare CommonJS under the same root"type": "module"and will hit the identical error whenever Cypress is run. They are not touched here because no CI job currently runs them — worth a separate issue.Screenshots of Proposed Changes Of The Website (if any, please do not screen shot code changes)
No user-facing changes — CI configuration only.
🤖 Generated with Claude Code