Skip to content

ci: load workflow scripts as .cjs (fixes notifier/scan under "type": "module") - #180

Merged
afeezorobsco-cyber merged 1 commit into
mainfrom
ci/scripts-cjs
Oct 20, 2026
Merged

afeezorobsco-cyber merged 1 commit into
mainfrom
ci/scripts-cjs

Conversation

@afeezorobsco-cyber

Copy link
Copy Markdown
Contributor

What changed

Renames .github/scripts/pr-conflict-notifier.js and .github/scripts/pr-malware-scan.js to .cjs, and updates the two workflows and ROADMAP.md to match.

Why

docforum-web's package.json has "type": "module", so Node treated the .js scripts as ES modules. Both workflows failed there with ReferenceError: module is not defined in ES module scope (the first conflict-notifier runs on web main failed this way). Malware scan is now a required check, so every web PR push would have been blocked. .cjs is always CommonJS whatever package.json says, so the scripts are renamed in all three repos to keep them identical and future-proof.

Testing

  • Reproduced locally: in a directory whose package.json has "type": "module", require() of the old .js fails, and both .cjs files load.
  • Re-ran the scanner on the escrow Feat/multiple staff users per facility fixed roles no #163 fixture (3 HIGH, as before) and dry-ran the notifier against web (completes).

Which ROADMAP.md item does this close/progress?

Updates the file paths in the existing notifier and malware-scan items.

🤖 Generated with Claude Code

docforum-web's package.json sets "type": "module", so Node loaded
.github/scripts/*.js as ES modules and both workflows failed with
"module is not defined in ES module scope". .cjs is always CommonJS
regardless of package.json, so the scripts work in every repo. Renamed in
all three repos to keep them identical.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Malware scan: passed, with notes for the reviewer

Nothing malicious was detected in 0002dd4. These changes touch sensitive areas and should get a careful look before CI is approved:

Where Rule Why
.github/workflows/pr-conflict-notifier.yml:45 workflow-change Changes a CI workflow; a maintainer must review before approving runs.
.github/workflows/pr-malware-scan.yml:4 workflow-change Changes a CI workflow; a maintainer must review before approving runs.

@afeezorobsco-cyber
afeezorobsco-cyber merged commit ebd1221 into main Oct 20, 2026
2 checks passed
@afeezorobsco-cyber
afeezorobsco-cyber deleted the ci/scripts-cjs branch October 20, 2026 09:27
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.

1 participant