Skip to content

Conversation

@jackmisner
Copy link
Owner

@jackmisner jackmisner commented Jan 21, 2026

  • Rename ci.yml to format.yml (handles auto-formatting only)
  • Add ci-node18.yml, ci-node20.yml, ci-node22.yml for testing
  • Test workflows trigger via workflow_run after Format completes
  • This prevents duplicate CI runs when auto-format commits
  • Add Format badge and update CI badges in README

Summary by CodeRabbit

  • Chores

    • Restructured CI into dedicated workflows for Node.js 18, 20 and 22 with per-version test, lint, type-check and build runs.
    • Centralised formatting workflow that can auto-format and commit fixes when allowed.
    • Updated package scripts to separate type-check and lint, and added a lint:fix command.
  • Tests

    • Added coverage upload in the Node 22 workflow.
  • Documentation

    • Added a CI status badge to the README.

✏️ Tip: You can customize this high-level summary in your review settings.

  - Rename ci.yml to format.yml (handles auto-formatting only)
  - Add ci-node18.yml, ci-node20.yml, ci-node22.yml for testing
  - Test workflows trigger via workflow_run after Format completes
  - This prevents duplicate CI runs when auto-format commits
  - Add Format badge and update CI badges in README
@coderabbitai
Copy link

coderabbitai bot commented Jan 21, 2026

Walkthrough

Reorganises CI into modular workflows: a standalone Format workflow and three Node-specific CI workflows (Node 18, 20, 22). The top-level ci.yml now invokes these external workflows. Also updates package scripts/dev-deps, README badge, and a small change in config merge logic.

Changes

Cohort / File(s) Summary
Top-level CI orchestration
.github/workflows/ci.yml
Replaces monolithic matrix job with a lightweight orchestrator that calls external workflows: uses the Format workflow and triggers ci-node18.yml, ci-node20.yml, ci-node22.yml as downstream workflows. Inlined steps removed.
Format workflow
.github/workflows/format.yml
New workflow for code formatting invoked via workflow_call. Checks out code, sets up Node 22, runs npm ci and npm run format, detects formatting changes, handles forked PRs (rejects on fork with changes), and commits/pushes formatting fixes when allowed.
Node-specific CI workflows
.github/workflows/ci-node18.yml, .github/workflows/ci-node20.yml, .github/workflows/ci-node22.yml
Three new workflows (each workflow_call) that run on ubuntu-latest, set up Node 18/20/22, install deps, run type-check, lint, tests, and npm run build. The Node 22 workflow additionally runs coverage and uploads to Codecov.
Documentation
README.md
Adds a CI status badge line immediately after the README title.
Package configuration
package.json
Adjusts scripts: introduces type-check (runs tsc --noEmit), updates lint to use oxlint, adds lint:fix, and adds oxlint as a dev dependency.
Config loader logic
src/config/loader.ts
In mergeShareContextParams, the object spread changed from `...(base[key]
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title 'Split CI into separate workflows per Node version' accurately and clearly describes the main change: refactoring CI workflows from a monolithic structure into separate workflows for each Node version (18, 20, 22).

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In @.github/workflows/ci-node22.yml:
- Around line 41-46: The Codecov v4 step using codecov/codecov-action@v4 needs
an authentication token to upload coverage; update the action inputs for the
step that currently sets directory/name/fail_ci_if_error to include the token
input pointing to the repository secret (use secrets.CODECOV_TOKEN) so uploads
succeed (i.e., add token: ${{ secrets.CODECOV_TOKEN }} to the
codecov/codecov-action@v4 step).
🧹 Nitpick comments (5)
.github/workflows/ci-node20.yml (2)

15-18: Consider using head_sha instead of head_branch for deterministic checkout.

Using head_branch means this workflow may check out a different commit than what the Format workflow processed, if new commits are pushed between workflows. This could lead to inconsistent CI results.

Suggested fix
      - name: Checkout code
        uses: actions/checkout@v4
        with:
-          ref: ${{ github.event.workflow_run.head_branch }}
+          ref: ${{ github.event.workflow_run.head_sha }}

29-30: Minor: Step name doesn't match action.

The step is named "TypeScript type checking" but runs npm run lint, which typically includes more than just type checking. Consider renaming to "Lint" or "Run lint checks" for clarity.

.github/workflows/ci-node18.yml (2)

15-18: Same head_branch vs head_sha concern applies here.

As noted in the Node 20 workflow, using head_branch instead of head_sha could lead to checking out different code than what the Format workflow validated.

Suggested fix
      - name: Checkout code
        uses: actions/checkout@v4
        with:
-          ref: ${{ github.event.workflow_run.head_branch }}
+          ref: ${{ github.event.workflow_run.head_sha }}

1-39: Optional: Consider consolidating with reusable workflows.

The Node 18, 20, and 22 workflows share nearly identical structure. GitHub Actions supports reusable workflows which could reduce duplication and simplify maintenance.

This is fine for now, but worth considering if the CI logic grows more complex.

.github/workflows/ci-node22.yml (1)

15-18: Same head_branch vs head_sha concern applies here.

For consistency and determinism, consider using head_sha instead of head_branch.

Suggested fix
      - name: Checkout code
        uses: actions/checkout@v4
        with:
-          ref: ${{ github.event.workflow_run.head_branch }}
+          ref: ${{ github.event.workflow_run.head_sha }}

  CI improvements:
  - Add ci.yml orchestrator that triggers on push/PR
  - Convert format.yml and ci-node*.yml to reusable workflows (workflow_call)
  - Format runs first, test workflows depend on it via `needs`
  - Add Codecov token for coverage uploads
  - Update README to single CI badge

  Linting:
  - Add oxlint for actual linting (separate from type checking)
  - Rename `lint` script to `type-check` (tsc --noEmit)
  - Add `lint` and `lint:fix` scripts for oxlint
  - Fix lint warning: remove unnecessary fallback in spread
@jackmisner jackmisner merged commit c74b08d into main Jan 21, 2026
5 checks passed
@jackmisner jackmisner deleted the separate-CI-into-node-versions branch January 21, 2026 17:20
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