Repository navigation
ci: publish crates with trusted publishing - #173
Conversation
👁️ Cyclops Security Review✅ Reviewed e7685ad (latest) · Coverage: not needed ·
|
| on: | ||
| push: | ||
| tags: | ||
| - "*-v[0-9]*" |
There was a problem hiding this comment.
Medium (exposure and trigger unconfirmed): publish.yml on-main release gate is defined by the pushed tag itself
The only check that a release tag points at a commit on main is a shell step in publish.yml's verify job. A tag push runs the workflow file from the tagged commit, so an off-main commit that edits that step away still requests the release environment and the publish.yml OIDC identity.
Valid? React with 👍 / 👎.
| on: | ||
| push: | ||
| tags: | ||
| - "*-v[0-9]*" |
There was a problem hiding this comment.
Informational: Tag-push-only publish workflow leaves undelivered release tags unpublished
publish.yml starts only from a tag push event and release.toml turns off cargo-release's local publish. If GitHub creates no push event for a release tag, documented for pushes carrying more than three tags, no run starts and the crate is never uploaded. The five-crate workspace needs up to five tags per release.
Valid? React with 👍 / 👎.
Drop the v<version> branch and LOCKSTEP from release-packages.sh: no push triggers it and the release environment would refuse it. Note on the publish job that the environment's reviewers are the security boundary. Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a1e530-c3d3-7112-83c3-faf37ebd3cb9
a90b98c to
e7685ad
Compare
Publish crates to crates.io from CI with trusted publishing instead of personal tokens. Same setup as alloy-rs/alloy#4528.
publish.yml: on*-v[0-9]*tags (or a manual run on a tag), checks versions, dry-runs, then publishes from thereleaseenvironment.release-packages.sh: resolves the crate a<crate>-v<version>tag releases and checks its version.release.toml:publish = false, socargo releasetags and CI publishes.GitHub runs
publish.ymlfrom the tagged commit, so anyone who can push a tag can drop the checks in the workflow. Thereleaseenvironment's reviewers, tag protection, and the crates.io environment pin are what stop an unauthorized publish; none exist yet.Setup before the first release (repo admin and crates.io owners):
releaseenvironment: required reviewers with "Prevent self-review" on, admins not allowed to bypass, deployments limited to tags matching*-v[0-9]*(no branch rules). Reviewers approve only a commit that is onmain.*-v*tags to release maintainers.publish.yml, environmentrelease) foralloy-eip2124,alloy-eip2930,alloy-eip7702,alloy-eip7928,alloy-eip8141. Always set the environment: theverifyjob holdsid-token: write(secure-runner needs it) while it builds dependencies, so a trusted publisher without an environment would let a dependency build script publish. Remove any existing publisher that has no environment.