Skip to content

update dependencies and runtime, switch to curated schemas, other cleanups - #18

Open
mvdan wants to merge 5 commits into
mainfrom
bumps
Open

update dependencies and runtime, switch to curated schemas, other cleanups#18
mvdan wants to merge 5 commits into
mainfrom
bumps

Conversation

@mvdan

@mvdan mvdan commented Jul 16, 2026

Copy link
Copy Markdown
Member

(see commit messages - please do not squash)

@mvdan

mvdan commented Jul 16, 2026

Copy link
Copy Markdown
Member Author

Split into many commits to hopefully simplify review, PTAL. I'm no expert in any of this, so I'm relying quite a bit on Fable.

mvdan added 5 commits July 16, 2026 13:45
Bump @actions/core, @actions/exec, and @actions/tool-cache to their
latest CommonJS majors; the newest majors are ESM-only and would
require migrating the action and its tests to ESM.

Bump the dev dependencies to their latest versions, with two caveats:
jest 30 removed the toBeCalled matcher aliases, and TypeScript stays
on 5.x since ts-jest caps it below 7.0 and 6.0 force-enables
esModuleInterop, which breaks the spy-based tests.

Deny the unrs-resolver postinstall script, which npm blocks with a
warning and jest works fine without.

Rebuild dist accordingly. The jest tests pass again with these
versions.

Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
cue commands now require a language version in module.cue; add it via
'cue mod fix'.

The genworkflows tasks generated inside the comprehension no longer
have their dependency on the repoRoot exec task tracked, failing with
a non-concrete stdout. Drop the indirection and write the files
relative to the working directory, which is always the repo root when
running cue cmd.

Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
Replace the schemas vendored from schemastore.org under cue.mod/pkg
with the cue.dev/x/githubactions module from the Central Registry,
which CUE resolves and fetches automatically. This makes the
vendorgithubschema command and its CI step redundant.

Regenerating action.yml with CUE v0.17.1 also reorders some fields.

Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
Use the latest actions/checkout and actions/setup-node with node 24,
matching the action's new runtime, and test against CUE v0.17.1, the
current latest release.

Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
The tests were disabled in CI when they broke with newer
dependencies; they pass again, so run them in the step that so far
only ran 'npm ci'.

Importing src/run.ts invoked run() as a side effect, so jest ran it
unmocked and core.setFailed marked the process as failed even with
all tests passing. Only invoke run() when executed as the entrypoint,
and rebuild dist.

Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
@grelland

Copy link
Copy Markdown

👋
Any chance this can be merged soon? We're relying on this action, but the current node version it's using is past EOL on Actions...

@mvdan

mvdan commented Aug 27, 2026

Copy link
Copy Markdown
Member Author

Thanks for the ping - I forgot to follow up here.

@myitcv myitcv left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, thanks. I reviewed this commit by commit and verified the claims hands-on in a local checkout:

  • npm ci && npm run dist reproduces dist/index.js byte-identical, so the committed bundle is a faithful build of src/ with the locked deps.
  • All 14 jest tests pass, and they also pass with npm ci --ignore-scripts, confirming that denying the unrs-resolver postinstall via allowScripts is safe.
  • The require.main === module guard survives the ncc bundling: require('./dist/index.js') does not invoke run(), while node dist/index.js does (failing on the missing version input as expected).
  • cue cmd genaction and cue cmd genworkflows with CUE v0.17.1 (matching CI) regenerate everything with zero diff.
  • actions/checkout@v7 and actions/setup-node@v7 exist, v0.17.1 is the latest CUE release, and @actions/core 2.0.3 / @actions/exec 2.0.0 / @actions/tool-cache 3.0.1 are the latest majors before the ESM-only ones, as the commit message says.

A few optional, non-blocking suggestions:

  1. cue.dev/x/githubactions has moved on to v0.8.0 since this PR was authored. I checked that cue mod get cue.dev/x/githubactions@v0.8.0 followed by both regen commands produces no diff beyond cue.mod/module.cue, so bumping is free if you want it fresh at merge time.
  2. npm audit flags undici@6.27.0 (moderate advisories), which ships in dist/index.js via @actions/core -> @actions/http-client@3.0.2 (^6.23.0). undici 6.28.0 fixes it and is in range, so npm audit fix plus a dist rebuild would clear it. The other audit hits (brace-expansion, js-yaml) are jest-only dev deps and do not ship.
  3. Pre-existing and out of scope here, but worth a follow-up: action.yml declares the output as cue-path, while the code sets (and the README documents) cuectl-path, so the declared output name is never actually set.

One question on "all: fix CUE tooling for CUE v0.17": is the tools/flow regression (comprehension-generated tasks losing their dependency on the repoRoot exec task) filed upstream? I could not find an issue for it, and it would be good to reference one rather than only working around it.

(Review assisted by Claude Code, claude-fable-5.)

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