Skip to content

Update GitHub Actions to Node 24 majors, install nats-server via shared action - #1618

Merged
scottf merged 4 commits into
mainfrom
update-actions-node24
Aug 25, 2026
Merged

Update GitHub Actions to Node 24 majors, install nats-server via shared action#1618
scottf merged 4 commits into
mainfrom
update-actions-node24

Conversation

@scottf

@scottf scottf commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

The four build workflows pin action majors that still declare node20, so runs log:

Node.js 20 is deprecated. The following actions target Node.js 20 but are being forced to run on Node.js 24: actions/checkout@v4, actions/setup-go@v5, actions/setup-java@v4, gradle/actions/setup-gradle@v4.

(Seen on https://github.com/nats-io/nats.java/actions/runs/32369985188.)

I checked each action's runs.using against the live repos and bumped them to the first major that declares node24:

action was now
actions/checkout v4 v5
actions/setup-java v4 v5
gradle/actions/setup-gradle v4 v5
actions/setup-go v5 removed — see below

Applied to branch-snapshot.yml, build-main.yml, build-pr.yml and build-release.yml.

coverallsapp/github-action@v2 is a composite action with no Node runtime of its own, which is why it isn't in the warning list — left alone. claude.yml calls a reusable workflow in synadia-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 calls go build directly and relies on the Go preinstalled on the runner image, so actions/setup-go comes 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 GOTOOLCHAIN problem disappear. setup-go@v6 unconditionally exports GOTOOLCHAIN=local, which would have meant the nats-server build failing rather than fetching a toolchain when its go.mod asks for one newer than the installed Go. With setup-go gone nothing sets the variable, so it defaults to auto. That matters concretely right now: the ubuntu-24.04 image ships Go 1.26.6 while nats-server declares toolchain go1.26.7, so the build does fetch a toolchain — correct under auto, and it would have been a hard failure under local.

gradle/actions@v6 deliberately skipped. v6 extracts the caching logic into gradle-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 in setup-gradle, so v6 would pull a commercial component into every build of an Apache-2.0 repo. v5 is node24 and 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_server is referenced at @main, as it is in v3. synadia-io/workflows has 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

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.
@synadia-claude-reviewer

synadia-claude-reviewer Bot commented Aug 25, 2026

Copy link
Copy Markdown

Claude finished @scottf's task in 52s —— View job


PR Review: Update GitHub Actions to Node 24 Compatible Majors

  • Gather context and read PR diff
  • Review changes for correctness, security, and behavioral implications

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:

setup-go@v6 sets GOTOOLCHAIN=local

The PR description flags this in passing, but it deserves a concrete risk statement: with GOTOOLCHAIN=local, if nats-server's go.mod ever declares a go directive requiring a toolchain newer than whatever go-version: stable resolves to at that moment, the nats-server build step will fail instead of auto-fetching the required toolchain as it does today. The current state (go1.27.0 stable vs nats-server's go 1.26.0 minimum) is fine, but this is a latent trip-wire on the nats-server upgrade path. Adding env: GOTOOLCHAIN: auto to the "Setup GO" step proactively would eliminate that risk with no downside — worth considering even if not strictly necessary right now.

Everything else looks correct:

  • Version bumps are identical across all four files — no drift between workflows.
  • Skipping gradle/actions@v6 due to the proprietary caching component and MIT-license concern is the right call for an Apache-2.0 project.
  • checkout@v5 is safe; the pull_request_target restriction the PR mentions applies to v7, not v5.
  • coverallsapp/github-action@v2 and claude.yml are correctly left untouched.

The suggestion in the PR description to add a .github/dependabot.yml github-actions ecosystem entry is worth following up on to prevent this class of drift in the future.

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.
@scottf

scottf commented Aug 25, 2026

Copy link
Copy Markdown
Contributor Author

Took the GOTOOLCHAIN suggestion — done in 1e7ceb5 — but the placement needed to change, so flagging it here for anyone reading later.

Adding env: GOTOOLCHAIN: auto to the Setup GO step, as suggested, would not have worked. setup-go@v6's setGoToolchain() runs unconditionally: it ignores any pre-existing GOTOOLCHAIN and calls core.exportVariable('GOTOOLCHAIN', 'local'), which writes to $GITHUB_ENV and so applies to every subsequent step. A step-level env on the Setup GO step only affects that action's own process, and the exported local would still have been in force by the time go build ran in the next step.

So the override sits on the Install Nats Server step instead — the one that actually runs go build — where step-level env takes precedence over what a prior step exported to $GITHUB_ENV. Applied to all four workflows.

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.
@scottf scottf changed the title Update GitHub Actions to Node 24 compatible majors Update GitHub Actions to Node 24 majors, add dependabot for action updates Aug 25, 2026
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.
@scottf scottf changed the title Update GitHub Actions to Node 24 majors, add dependabot for action updates Update GitHub Actions to Node 24 majors, install nats-server via shared action Aug 25, 2026
@scottf
scottf merged commit a6070f5 into main Aug 25, 2026
5 checks passed
@scottf
scottf deleted the update-actions-node24 branch August 25, 2026 15:23
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.

2 participants