Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[architect] setup-node + npm ci block duplicated across 9 workflow files, with drifting node-version handling

Closed
#1,558 3 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

A pull request for this has already been merged.

  • #1577 by @mrbobbytables — merged

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Refactor
Clarity
Clearly specified
Activity status
Active
Tech stack
github-actions, javascript, node.js
Domain
ci-cd, tooling

Research direction

Read the listed .github/workflows/*.yml files and compare the repeated actions/setup-node and npm ci steps, including how each handles NODE_VERSION. Start by adding the composite action at .github/actions/setup-node-deps/action.yml, then check that all 11 steps across the nine workflows use it and the version handling is consistent. The issue says workflow edits require a human or an agent with Workflows permission.

Written by the indexing model from the issue text.

Description

🐝 covered by PR agent/architect architecture hive/hosted-available-lke648397-260827-5n31 tech-debt

Architecture Finding

Type: tech-debt (duplicated CI configuration)
Affected area: .github/workflows/*.yml

The same four-line block —

- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
  with:
    node-version: <22 or ${{ env.NODE_VERSION }}>
    cache: npm
- run: npm ci

is repeated verbatim across 11 job steps in 9 workflow files:
ci.yml (2 jobs), architecture-submission.yml, audit-schedule.yml,
check-links.yml, pr-queue-hygiene.yml, refresh-community-people.yml,
refresh-metrics.yml, refresh-radar-reports.yml.

The node-version handling has already drifted: architecture-submission.yml,
check-links.yml, refresh-community-people.yml, refresh-metrics.yml and
refresh-radar-reports.yml define an env.NODE_VERSION: '22' and reference it;
ci.yml, audit-schedule.yml and pr-queue-hygiene.yml hardcode the literal
22 directly in the setup-node step instead. A future Node bump has two
different places to remember to edit depending on which file a contributor
copies from, and nothing catches an inconsistency if one workflow is missed.

Impact

Nine independent copies of the same setup step mean a future change to the
install step itself (e.g. adding a shared cache key, an engine-version check,
or a corepack enable) has to be applied at 11 call sites and re-verified at
each one, with no single place that proves they still agree. The existing
node-version drift is a concrete instance of exactly this already happening.

Recommendation

Extract the block into a composite action,
.github/actions/setup-node-deps, taking node-version as an input
(defaulting to '22'), and have every workflow call
uses: ./.github/actions/setup-node-deps (with node-version: ${{ env.NODE_VERSION }} where a workflow already keeps that variable) in place of
its own setup-node+npm-ci pair.

  • Composite action added at .github/actions/setup-node-deps/action.yml
  • All 11 job steps across the 9 workflow files above call the composite
    action instead of repeating setup-node+npm-ci
  • The env.NODE_VERSION vs. hardcoded 22 inconsistency is resolved
    (every workflow either defines the env var and passes it, or relies on
    the action's default)

Note for whoever picks this up: this agent runs at the contributor
token tier, which lacks the Workflows permission, so any diff touching
.github/workflows/** is rejected server-side regardless of what the hive
installation grants. The companion PR to this issue adds only the composite
action itself (not under .github/workflows/), which is pushable. The two
unchecked boxes above — rewiring the 9 workflow files to call it — require a
human or an ISSUES_PRS_MERGE-tier agent to land.


Filed by architect agent (ACMM L5 — hold-gated mode).


🐝 Hive Agent: architect | Instance: hosted-available-lke648397-260827-5n31 | SHA: 7bb743d

— hive: agent=architect backend=copilot model=claude-opus-4-6 copilot=1.0.88

Dominant language
JavaScript
Stars
0
Forks
3
Avg merge
7h 14m
Merged PRs (30d)
597

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from cncf/endusers

All issues in cncf/endusers

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.