Bump @actions/core from 2.0.2 to 3.0.1 - #108
Conversation
@actions/core 3.0.0 is ESM-only ("type": "module", and its exports map
offers only an "import" condition). The upstream release notes state
that "CommonJS consumers must use dynamic import() instead of
require()", so a plain version bump cannot work: ncc failed with
"Package path . is not exported from package @actions/core", which
also aborted `npm ci` via the prepare script and took the units job
down with it.
Migrate the action to ESM instead:
- Add "type": "module" and convert index.js and find-python-projects.js
to import/export. ncc then bundles dist/index.js as ESM and emits its
own dist/package.json type marker plus sourcemap-register.cjs,
replacing the now-stale sourcemap-register.js.
- Rewrite the test mocks. ESM namespace objects are sealed, so
jest.spyOn can no longer patch @actions/core or the local module;
both tests now use jest.unstable_mockModule ahead of a dynamic
import. Native ESM in Jest needs --experimental-vm-modules, so the
test script invokes jest through node directly.
- Point eslint at the new module system (sourceType module, ecmaVersion
2022 for top-level await) and drop the commonjs globals.
Also declares globals, @eslint/js and @eslint/eslintrc, which
eslint.config.cjs requires but nothing depended on. These stopped being
hoisted transitives when eslint 10 landed in #113, so `npm run lint`
had been failing outright on main; declaring them is what makes the
lint change above verifiable.
action.yml is unchanged: the node20 runtime runs ESM fine, and
@actions/core 3 sets no engines constraint. All 4 snapshots still match
byte-for-byte, so behavior is unchanged.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
f1d3e38 to
9d72982
Compare
|
This one could not be fixed by a rebuild, so I rebased it onto current Why the bump was failing. That surfaced as two separate red checks: ncc could not build ( What changed.
One bundled fix worth flagging. Verification.
🤖 Generated with Claude Code |
|
OK, I won't notify you again about this release, but will get in touch when a new version is available. If you'd rather skip all updates until the next major or minor version, let me know by commenting If you change your mind, just re-open this PR and I'll resolve any conflicts on it. |
… PRs Summary: ======= Three Dependabot PRs (#108, #114, #120) were all stuck on a red `check-dist` because Dependabot only edits `package.json` / `package-lock.json` and never rebuilds the checked-in `dist/` bundle. #108 was additionally red on `units`: `@actions/core` 3.0.0 is ESM-only and its `exports` map declares no `require` condition, so `require("@actions/core")` fails outright with `ERR_PACKAGE_PATH_NOT_EXPORTED` on any Node version. Taking that bump therefore required converting the action from CommonJS to ESM, which pairs naturally with moving the published runtime to node24. Two latent CI defects surfaced while verifying the above and are fixed here: - `node-version-file: package.json` never resolved, because the manifest had no `engines.node`. setup-node logged "Could not determine node version ... Falling back" and silently built `dist/` on the runner's Node 22, so CI was not exercising the runtime the action declares. - The `check-dist` comparison used `git diff`, which cannot see files the build newly adds. ncc 0.44 emits `dist/package.json` and renames `sourcemap-register.js` to `.cjs`; without the untracked-file check, shipping the action with a missing `sourcemap-register.cjs` would have passed CI and failed at runtime. Actions: ======= - Convert `index.js` and `find-python-projects.js` to ESM named exports and set `"type": "module"`. - Rewrite the test suite to mock via `jest.unstable_mockModule`, since frozen ESM namespaces cannot be patched by `jest.spyOn`; run jest under `--experimental-vm-modules`. All 12 tests and 4 snapshots pass unchanged, confirming the migration is behavior-neutral. - Bump `@actions/core` to ^3.0.1 (#108) and `@vercel/ncc` to ^0.44.0 (#114). - Apply the npm_and_yarn security group (#120): brace-expansion 1.1.12 -> 1.1.18 and 2.1.0 -> 2.1.4, flatted 3.3.3 -> 3.4.4, undici 5.29.0 -> 6.28.0. - Set `runs.using` to node24 in `action.yml` and add `engines.node: ^24.0.0` so `node-version-file: package.json` resolves. - Add setup-node to the `units` job so unit tests run on the same pinned Node. - Harden the `check-dist` comparison to also fail on untracked files in `dist/`. - Repair `npm run lint`, broken since the eslint 10 bump: the flat config imported `globals`, `@eslint/js` and `@eslint/eslintrc`, none of which were declared and which eslint 10 no longer provides transitively. Declare `globals` and `@eslint/js`, and drop the `FlatCompat`/eslintrc shim in favor of `js.configs.recommended`. - Rebuild `dist/`; add `dist/package.json` and `dist/sourcemap-register.cjs`, remove the now-stale `dist/sourcemap-register.js`. BREAKING CHANGE: the action now runs on the node24 runtime and its sources are ESM. Consumers referencing the action by tag are unaffected, but GitHub Actions runners must support `runs.using: node24`. ai-generated: true
… PRs (#121) * chore!: migrate to ESM, adopt node24 runtime, roll up open Dependabot PRs Summary: ======= Three Dependabot PRs (#108, #114, #120) were all stuck on a red `check-dist` because Dependabot only edits `package.json` / `package-lock.json` and never rebuilds the checked-in `dist/` bundle. #108 was additionally red on `units`: `@actions/core` 3.0.0 is ESM-only and its `exports` map declares no `require` condition, so `require("@actions/core")` fails outright with `ERR_PACKAGE_PATH_NOT_EXPORTED` on any Node version. Taking that bump therefore required converting the action from CommonJS to ESM, which pairs naturally with moving the published runtime to node24. Two latent CI defects surfaced while verifying the above and are fixed here: - `node-version-file: package.json` never resolved, because the manifest had no `engines.node`. setup-node logged "Could not determine node version ... Falling back" and silently built `dist/` on the runner's Node 22, so CI was not exercising the runtime the action declares. - The `check-dist` comparison used `git diff`, which cannot see files the build newly adds. ncc 0.44 emits `dist/package.json` and renames `sourcemap-register.js` to `.cjs`; without the untracked-file check, shipping the action with a missing `sourcemap-register.cjs` would have passed CI and failed at runtime. Actions: ======= - Convert `index.js` and `find-python-projects.js` to ESM named exports and set `"type": "module"`. - Rewrite the test suite to mock via `jest.unstable_mockModule`, since frozen ESM namespaces cannot be patched by `jest.spyOn`; run jest under `--experimental-vm-modules`. All 12 tests and 4 snapshots pass unchanged, confirming the migration is behavior-neutral. - Bump `@actions/core` to ^3.0.1 (#108) and `@vercel/ncc` to ^0.44.0 (#114). - Apply the npm_and_yarn security group (#120): brace-expansion 1.1.12 -> 1.1.18 and 2.1.0 -> 2.1.4, flatted 3.3.3 -> 3.4.4, undici 5.29.0 -> 6.28.0. - Set `runs.using` to node24 in `action.yml` and add `engines.node: ^24.0.0` so `node-version-file: package.json` resolves. - Add setup-node to the `units` job so unit tests run on the same pinned Node. - Harden the `check-dist` comparison to also fail on untracked files in `dist/`. - Repair `npm run lint`, broken since the eslint 10 bump: the flat config imported `globals`, `@eslint/js` and `@eslint/eslintrc`, none of which were declared and which eslint 10 no longer provides transitively. Declare `globals` and `@eslint/js`, and drop the `FlatCompat`/eslintrc shim in favor of `js.configs.recommended`. - Rebuild `dist/`; add `dist/package.json` and `dist/sourcemap-register.cjs`, remove the now-stale `dist/sourcemap-register.js`. BREAKING CHANGE: the action now runs on the node24 runtime and its sources are ESM. Consumers referencing the action by tag are unaffected, but GitHub Actions runners must support `runs.using: node24`. ai-generated: true * chore: declare @jest/globals and match sibling repos' test invocation Summary: ======= The ESM test suite imports `jest`, `describe`, `it`, `expect` and `beforeEach` from `@jest/globals`, but that package was only reachable transitively through `jest`. That is the same undeclared-import bug class that had already broken `npm run lint` on main, so declare it explicitly before it bites. Also aligns the test script with the sibling action repos (pipx-install-action, python-test-matrix-generator-action), which additionally silences the VM-modules ExperimentalWarning. Actions: ======= - Add `@jest/globals` ^30.4.2 to devDependencies. - Change the `test` script to `NODE_OPTIONS=--experimental-vm-modules NODE_NO_WARNINGS=1 jest`. ai-generated: true
Bumps @actions/core from 2.0.2 to 3.0.1.
Changelog
Sourced from
@actions/core's changelog.... (truncated)
Commits
You can trigger a rebase of this PR by commenting
@dependabot rebase.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebasewill rebase this PR@dependabot recreatewill recreate this PR, overwriting any edits that have been made to it@dependabot show <dependency name> ignore conditionswill show all of the ignore conditions of the specified dependency@dependabot ignore this major versionwill close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor versionwill close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependencywill close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)