Fix Generate Contributors PNG workflow: convert script to ESM - #9055
Fix Generate Contributors PNG workflow: convert script to ESM#9055Vaivaswat2244 wants to merge 1 commit into
Conversation
Continuous ReleaseCDN linkPublished PackagesCommit hash: cef6e05 Previous deploymentsThis is an automated message. |
|
@Vaivaswat2244 thank you for spotting this one, good work! traced this back to the branch switch(#8871), when 2.x became tldr; the script worked fine before the default branch switched to v2. also tested the fix locally, @ksen0 we can merge this one! |
|
Thanks for the confirmation @skyash-dev . Though this is still a stopgap and this should be perma fixed with processing/all-contributors-image#4 I have left some reviews there, which should help the pr converge to approval soon. Thanks again |

Changes
The
Generate Contributors PNGworkflow fails on every run withReferenceError: require is not defined in ES module scope.utils/contributors-png.jsis CommonJS, butpackage.jsonhas"type": "module", so Node resolves it as ESM. It fails on every Node version — the script was added a month after the repo switched to ESM and has never worked, which is whycontributors.pnghas only ever been updated by hand.utils/contributors-png.js→utils/contributors-png.mjsand converted it to ESM (importinstead ofrequire, top-levelawaitinstead of the async IIFE). Matchesutils/, where every other script is already.mjs.run:step in.github/workflows/contributors-png.yml.No behaviour change beyond the module format.
The workflow can't run on a PR (
on: pushfiltered to.all-contributorsrc, gated onrefs/heads/main), so tested on a fork: . This is a stopgap — the script is meant to be replaced by processing/all-contributors-image#4.Screenshots of the change
PR Checklist
npm run lintpasses