refactor(ci): switch release flow to PR-based bump with API-created tag#516
Merged
Conversation
to `main` and then pushed an annotated tag — both blocked under DataDog org rulesets (PR-required, signed-commits, tag-creation restricted to allowlisted apps). New flow: - `release-prepare.yml` (schedule/dispatch): bumps Cargo.toml & Cargo.lock, creates a `release/v<X.Y.Z>` branch via Git Data API (signed by GitHub App), opens a PR. PR approval becomes the release gate, replacing the `release` GitHub Environment. - `release-tag.yml` (pull_request: closed): creates a lightweight tag pointing at the merge SHA via `gh api .../git/refs`. dd-octo-sts is on the org-wide tag protection bypass list (SECENG wiki 6360924697), and the tag inherits the signed merge commit. - Trust policies updated: `release` reverted to ref-based subject (no more `environment: release`), `pull_requests: write` added. New `release-tag` policy scoped to the PR-close workflow. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
platinummonkey
approved these changes
May 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The previous
release-prepare.ymlpushed a version-bump commit directly tomainand then pushed an annotated tag. Both steps are blocked under current DataDog org rulesets:mainrequires PRs + signed commits + status checks (no direct pushes).This PR splits the release into two workflows aligned with those rules.
Changes
release-prepare.yml— opens a release PR (no longer pushes to main)environment: release(PR approval is now the gate).Cargo.toml+ refreshesCargo.lockon the runner.release/v<X.Y.Z>branch — GitHub Apps sign commits made via the API, satisfyingrequired_signaturesonce squashed onto main.gh pr create.release-tag.yml(new) — creates the tag on PR mergepull_request: closed, gated bymerged == true && startsWith(head_ref, 'release/')and same-repo PR head.release-tagpolicy,contents: writeonly) to create a lightweight tag viagh api repos/.../git/refspointing at the merge SHA. The tag inherits the signed merge commit; tag creation succeeds because dd-octo-sts is on the org-wide bypass list.release.yml(goreleaser) unchanged.Trust policies
release.sts.yaml— subject reverted torepo:DataDog/pup:ref:refs/heads/main(no moreenvironment: release), addedpull_requests: writeforgh pr create.release-tag.sts.yaml(new) — scoped torelease-tag.ymlonly via tightjob_workflow_refregex;contents: writeonly.Test plan
Prepare Releaseand confirm it opens a PR with the version bump (no direct push to main).release-tag.ymlfires, creates thev<X.Y.Z>tag, and that the tag triggersrelease.yml.🤖 Generated with Claude Code