Skip to content

ci: PR test workflow + hardened npm publish - #11

Merged
pDJJq merged 2 commits into
mainfrom
ci/test-and-release-hardening
Aug 24, 2026
Merged

ci: PR test workflow + hardened npm publish#11
pDJJq merged 2 commits into
mainfrom
ci/test-and-release-hardening

Conversation

@pDJJq

@pDJJq pDJJq commented Aug 24, 2026

Copy link
Copy Markdown
Member

Two gaps closed:

1. No CI on pull requests

The repo only had the convert workflow (triggers on instruction-file paths) and the tag publish — PRs like #9/#10 ran zero checks. Adds .github/workflows/ci.yml: Node 20/22/24 matrix running npm ci && npm run build && npm test && npm pack --dry-run on every PR and main push.

2. Publish workflow: trusted publishing (OIDC), hardened

  • Tokenless: npm publish authenticates via the workflow's OIDC identity — no NPM_TOKEN secret; provenance is attached automatically (Node 24 bundles npm 11, which supports trusted publishing).
  • Idempotent: re-running the workflow for an already-published version skips instead of failing with 409.
  • npm cache, concurrency group, and a 10-minute timeout.

One-time npmjs.com setup (owner action)

On npmjs.com → @disdjj/acplugin → Settings → Trusted Publisher: select GitHub Actions, organization TokenRollAI, repository acplugin, workflow filename publish-npm.yml (environment: leave empty). Then delete any NPM_TOKEN secret — nothing uses it.

Release flow unchanged: bump version → tag vX.Y.Z → push tag.

pDJJq added 2 commits August 24, 2026 08:14
… auth)

The repo had no CI on pull requests at all — only the convert workflow
(instruction-file paths) and the tag publish. Adds a Node 20/22/24 matrix
running build + tests + pack dry-run on every PR and main push.

Publish hardening: skip when the version already exists on the registry
(safe re-runs), enable --provenance (id-token permission was already
declared but unused), wire NODE_AUTH_TOKEN explicitly, add npm cache,
concurrency group, and a timeout.
Configure publish-npm.yml as the package's trusted publisher on
npmjs.com; the job's OIDC identity (id-token: write) replaces any token
secret, and provenance is attached automatically. Node 24 already bundles
npm 11 which supports this.
@pDJJq
pDJJq merged commit f30df95 into main Aug 24, 2026
3 checks passed
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