Skip to content

ci: migrate to pnpm and adopt the shared PR checks workflow - #74

Merged
will-lamerton merged 3 commits into
mainfrom
ci/shared-pr-checks
Aug 30, 2026
Merged

ci: migrate to pnpm and adopt the shared PR checks workflow#74
will-lamerton merged 3 commits into
mainfrom
ci/shared-pr-checks

Conversation

@will-lamerton

Copy link
Copy Markdown
Member

Fifth repo onto the shared pr-checks workflow in Nano-Collective/.github.

Why this one needed a migration first

json-up was the only repo in the org still on npm and Node 20. Every other package is pnpm 11.0.9 on Node 22:

Before After
Package manager npm (package-lock.json) pnpm 11.0.9 (pnpm-lock.yaml)
engines.node >=20 >=22
packageManager unset pnpm@11.0.9

The shared workflow fixes one toolchain rather than carrying a package-manager input for a single outlier, so standardising here was the prerequisite.

pnpm-workspace.yaml

Added, because the first pnpm install reported:

[ERR_PNPM_IGNORED_BUILDS] Ignored build scripts: esbuild@0.28.2

pnpm blocks install scripts by default. esbuild is now explicitly the only dependency permitted to run one, matching how nanoterm and sentinel handle the same thing — an allowlist rather than a silent skip.

Verified locally under pnpm before pushing

All six blocking checks, run against the new lockfile:

Check Result
test:lint PASS
test:types PASS
test:format PASS
test:knip PASS
build PASS
test:ava:coverage PASS — 99.29%

That is the highest coverage in the org and comfortably clear of the 80% floor, so no interim threshold is needed here.

What it gains

Blocking — Linting, Type Checks, Format Checks, Unused Dependencies, Unit Tests & Coverage Analysis, Verify Build, plus fail-on-drop against the coverage badge on main.

Advisory — Package Audit Analysis, Semgrep Security Scan, CodeQL Security Analysis. They report but never fail the PR.

json-up was the only repo in the org still on npm and Node 20; every
other package is pnpm 11.0.9 on Node 22. That divergence is why it could
not join the shared PR checks workflow, which fixes one toolchain rather
than carrying a package-manager input for a single repo.

- package-lock.json replaced with pnpm-lock.yaml
- engines.node raised from >=20 to >=22
- packageManager pinned to pnpm@11.0.9, matching the org
- pnpm-workspace.yaml added so esbuild is the only dependency permitted
  to run install scripts, rather than pnpm silently ignoring build
  scripts as it did on first install

Verified under pnpm before pushing: lint, types, format, knip, build and
the full AVA suite all pass, coverage 99.29% — the highest in the org and
comfortably over the 80% floor.

Fifth repo onto the shared workflow.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014WoygKgfq3ahXinVVHqjA8
@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

will-lamerton and others added 2 commits August 30, 2026 14:56
The previous commit swapped the lockfile but left npm everywhere it was
actually invoked, so release.yml and update-badges.yml would both have
broken on merge — `npm ci` fails with ENOLOCK once package-lock.json is
gone. CI caught the first instance: test:audit was still `npm audit` and
failed in the advisory job.

- test:audit: npm audit -> pnpm audit --audit-level=high
  --ignore-unfixable, matching the rest of the org
- scripts/test.sh: npm run -> pnpm run throughout
- release.yml and update-badges.yml: add pnpm/action-setup, cache pnpm
  rather than npm, npm ci -> pnpm install --frozen-lockfile, and pnpm for
  build/test
- prepublishOnly: npm run -> pnpm run

`npm view` and `npm publish` stay as they are — publishing reads
package.json and the built files, and get-md does the same on pnpm.

Verified: `pnpm test:all` passes end to end, including the audit step
that failed in CI.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014WoygKgfq3ahXinVVHqjA8
Semgrep flagged three findings on the pnpm-workspace.yaml added in this
branch, all correct and all mine: the file allowlisted esbuild builds but
carried none of the hardening sentinel and nanocoder already use.

- blockExoticSubdeps: true
- minimumReleaseAge: 10080  (7 days)
- trustPolicy: no-downgrade

Verified with a clean install — node_modules removed, then
`pnpm install --frozen-lockfile` — so the release-age quarantine does not
reject anything currently resolved. No minimumReleaseAgeExclude needed,
unlike sentinel.

This is the posture the collective documents but applies inconsistently:
sentinel and nanocoder have it, prompt-scrubber does not (semgrep flags
the same three rules there). Worth a conformance check rather than
per-repo archaeology.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014WoygKgfq3ahXinVVHqjA8
@will-lamerton
will-lamerton merged commit 003eb55 into main Aug 30, 2026
10 checks passed
@will-lamerton
will-lamerton deleted the ci/shared-pr-checks branch August 30, 2026 14:01
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