Skip to content

ci: harden release pipeline against supply-chain attacks#20

Merged
trick77 merged 1 commit into
masterfrom
harden/tanstack-lessons
May 13, 2026
Merged

ci: harden release pipeline against supply-chain attacks#20
trick77 merged 1 commit into
masterfrom
harden/tanstack-lessons

Conversation

@trick77
Copy link
Copy Markdown
Owner

@trick77 trick77 commented May 13, 2026

Summary

Apply lessons from the May 2026 TanStack npm supply-chain compromise to this repo's CI/release pipeline.

  • ci.yaml: add explicit permissions: contents: read; fix push trigger that pointed at the non-existent main branch (default here is master).
  • release.yaml: gate the publish job on a new npm-publish GitHub Environment (required reviewer); add a concurrency group keyed on github.ref; pass --provenance to npm publish so the tarball carries SLSA build attestation verifiable via npm audit signatures.
  • AGENTS.md: new "package.json — supply-chain hygiene" section forbidding optionalDependencies, extra install-time lifecycle scripts, floating version ranges, and git/url/tarball specifiers — the shapes the TanStack worm payload used.

Manual follow-up

The npm-publish GitHub Environment must be created in repo Settings → Environments with a required reviewer, otherwise the new environment: key is a no-op gate.

Test plan

  • CI green on this PR (push-side trigger now actually fires on master after merge)
  • Cut a vX.Y.Z-rc.1 prerelease tag and confirm the publish job pauses awaiting environment approval
  • After next real release, npm audit signatures opencode-presets@<new> reports provenance verified

- ci.yaml: explicit minimum permissions, correct master branch trigger
- release.yaml: gate publish on npm-publish environment, add concurrency
  group, publish with --provenance for SLSA build attestation
- AGENTS.md: codify package.json supply-chain hygiene (no
  optionalDependencies, no extra install-time lifecycle scripts, no
  floating/url/git dependency specifiers)

NOTE: the npm-publish environment must be created in GitHub repo
settings with required reviewers, otherwise the gate is a no-op.
@trick77 trick77 merged commit c27197f into master May 13, 2026
2 checks passed
@trick77 trick77 deleted the harden/tanstack-lessons branch May 13, 2026 06:21
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