Skip to content

Move CI onto Node 24 actions and $GITHUB_OUTPUT - #64

Open
kapantzak wants to merge 1 commit into
masterfrom
chore/ci-node24-actions
Open

Move CI onto Node 24 actions and $GITHUB_OUTPUT#64
kapantzak wants to merge 1 commit into
masterfrom
chore/ci-node24-actions

Conversation

@kapantzak

Copy link
Copy Markdown
Contributor

Problem

Every CI run is annotated with:

Node.js 20 is deprecated. The following actions target Node.js 20 but are being forced to run on Node.js 24: actions/cache@v4, actions/checkout@v2, actions/setup-node@v2.1.2, actions/upload-artifact@v4

The reality is worse than the annotation. Two of those actions declare node12, not node20 — the runner has been silently force-upgrading them across four runtimes:

Action Pinned Declares Bumped to Declares
actions/checkout v2 node12 v7 node24
actions/setup-node v2.1.2 node12 v7 node24
actions/cache v4 node20 v6 node24
actions/upload-artifact v4 node20 v7 node24

upload-artifact needed v6 or later — v5 is still node20 and would not have cleared the warning.

Also fixed: deprecated ::set-output

Two occurrences remained in this workflow, deprecated in the same era as the Node 12 actions:

- run: echo "::set-output name=dir::$(yarn cache dir)"
- run: echo "::set-output name=BUILD_VERSION::$(jq -r .version package.json)"

Both now write to $GITHUB_OUTPUT. The step ids and output keys are unchanged, so every steps.*.outputs.* reference still resolves.

The second one matters more than it looks: BUILD_VERSION names the artifact that internal-deploy hands to Netdata Grafana Plugin Deploy in netdata/infra. If set-output is ever switched off, that breaks the deploy, not just the build.

Worth noting d3b875e ("Replace set-output with ...>>$GITHUB_OUTPUT") already did this once; it appears to have been reintroduced by the b441723 toolkit migration.

Deliberately not changed

  • node-version: '20.x' — that is the Node the plugin is built with, a separate decision from the runtime the actions themselves run on. Bumping it could change build output and belongs in its own change.
  • matrix.node-version in the node_modules cache key — there is no matrix in this workflow, so it interpolates to empty. Pre-existing and harmless (it just makes the key ${{ runner.os }}--nodemodules-…), left alone to keep this diff to one concern.

Verification

This PR's own CI run exercises every bumped action on the real runner — checkout, setup-node, both caches, the build, and the artifact upload. internal-deploy is gated on github.event_name == 'workflow_dispatch', so no deploy is triggered by this PR.

What CI here does not cover: the cross-repo artifact handoff. netdata/infra downloads the artifact with dawidd6/action-download-artifact@v6, and only a workflow_dispatch run reaches it. Bumping upload-artifact v4 → v7 should be transparent to that consumer, but it is the one interaction worth confirming with a manual dispatch after merge.

Suggested post-merge check:

gh workflow run ci.yml --ref master -f BRANCH=master

then confirm the run in netdata/infra downloads the artifact and completes.

The runner now forces every Node 20 action onto Node 24 and warns about it.
checkout and setup-node were worse than the warning suggested - both still
declared node12, four runtimes behind what they were executing on.

Bump each to its current major: checkout v7, setup-node v7, cache v6 and
upload-artifact v7. upload-artifact needed v6 or later; v5 is still node20.

Replace the two remaining ::set-output commands, deprecated alongside them.
The second one feeds BUILD_VERSION, which names the artifact the deploy job
hands to the infra workflow, so it fails the deploy rather than just the
build if the command is ever switched off.

node-version stays at 20.x - that is the Node the plugin is built with,
which is a separate decision from the runtime the actions run on.
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.

1 participant