Update GitHub Actions to Node 24 majors, install nats-server via shared action - #1618
Conversation
The runners now warn that checkout@v4, setup-java@v4, setup-go@v5 and setup-gradle@v4 declare node20 and are being forced onto Node.js 24. - actions/checkout v4 -> v5 - actions/setup-java v4 -> v5 - actions/setup-go v5 -> v6 - gradle/actions/setup-gradle v4 -> v5 Each of these is the first major of that action to declare node24. Deliberately not going to gradle/actions@v6, which moves the caching logic into the proprietary gradle-actions-caching component. coverallsapp/github-action@v2 is a composite action with no Node runtime of its own and was not flagged.
|
Claude finished @scottf's task in 52s —— View job PR Review: Update GitHub Actions to Node 24 Compatible Majors
This is a clean, well-documented maintenance change. The version bumps are applied consistently across all four workflow files and the PR description thoroughly justifies each choice. No correctness bugs or security issues found. One item worth making explicit:
The PR description flags this in passing, but it deserves a concrete risk statement: with Everything else looks correct:
The suggestion in the PR description to add a |
setup-go@v6 unconditionally exports GOTOOLCHAIN=local, so a go.mod that requires a toolchain newer than 'stable' would fail the build instead of fetching one. Restore the pre-v6 behavior for the nats-server build only. The override goes on the 'Install Nats Server' step rather than the 'Setup GO' step: setGoToolchain() ignores any pre-existing value and exports 'local' to $GITHUB_ENV for all subsequent steps, so only a step-level env on the step that actually runs 'go build' takes effect.
|
Took the Adding So the override sits on the Install Nats Server step instead — the one that actually runs |
Monthly, grouped into a single PR. This is the drift that produced the node20 deprecation warning in the first place. Only the github-actions ecosystem is enabled. gradle is left off on purpose: bcprov-lts8on is an api dependency pinned to the Java 8 LTS line, and equalsverifier 4.x requires Java 17, so automated bumps would either change our published transitive surface or fail to compile against sourceCompatibility 1.8.
Replaces the inlined clone-and-build block in all four workflows, and drops actions/setup-go entirely: the composite action calls 'go build' directly and relies on the Go preinstalled on the runner image. This also removes the GOTOOLCHAIN concern from the previous commit. Nothing sets GOTOOLCHAIN now, so it defaults to 'auto' and the nats-server build fetches the toolchain its go.mod names. Also drops the dependabot config added earlier on this branch.
The four build workflows pin action majors that still declare
node20, so runs log:(Seen on https://github.com/nats-io/nats.java/actions/runs/32369985188.)
I checked each action's
runs.usingagainst the live repos and bumped them to the first major that declaresnode24:actions/checkoutactions/setup-javagradle/actions/setup-gradleactions/setup-goApplied to
branch-snapshot.yml,build-main.yml,build-pr.ymlandbuild-release.yml.coverallsapp/github-action@v2is a composite action with no Node runtime of its own, which is why it isn't in the warning list — left alone.claude.ymlcalls a reusable workflow insynadia-io/ai-workflows, so its actions are that repo's concern.nats-server now installs via the shared action. Each workflow had its own inlined clone-and-build block; those are replaced with
synadia-io/workflows/.github/actions/install_nats_server@main, matching what v3 does. That composite action callsgo builddirectly and relies on the Go preinstalled on the runner image, soactions/setup-gocomes out entirely — which is both one less action to keep current and 17 lines of duplicated shell removed per workflow.Dropping setup-go also makes a
GOTOOLCHAINproblem disappear.setup-go@v6unconditionally exportsGOTOOLCHAIN=local, which would have meant the nats-server build failing rather than fetching a toolchain when itsgo.modasks for one newer than the installed Go. With setup-go gone nothing sets the variable, so it defaults toauto. That matters concretely right now: the ubuntu-24.04 image ships Go 1.26.6 while nats-server declarestoolchain go1.26.7, so the build does fetch a toolchain — correct underauto, and it would have been a hard failure underlocal.gradle/actions@v6deliberately skipped. v6 extracts the caching logic intogradle-actions-caching, a proprietary non-MIT component, and the release notes state that upgrading constitutes accepting Gradle's Terms of Use. Caching is on by default insetup-gradle, so v6 would pull a commercial component into every build of an Apache-2.0 repo. v5 isnode24and still fully MIT, so it clears the deprecation without raising the license question. Happy to revisit if we decide the terms are fine.Newer majors exist for the others (checkout v7, setup-java v6) but they're ESM and dependency refreshes that buy us nothing here. checkout v7 additionally blocks fork-PR checkout under
pull_request_target, which is worth steering clear of for now.One thing to note for review:
install_nats_serveris referenced at@main, as it is in v3.synadia-io/workflowshas no tags or releases, so a branch ref is the only option short of pinning a commit SHA — meaning the install step can change without a PR here. Fine given it's our own repo, but worth being deliberate about.This isn't urgent — the warning is non-fatal and GitHub is already force-running these on Node 24 — but the node20 runtime does go away eventually.
🤖 Generated with Claude Code