Skip to content

refactor(ci): switch release flow to PR-based bump with API-created tag#516

Merged
jack-edmonds-dd merged 1 commit into
mainfrom
refactor/release-pr-based
May 20, 2026
Merged

refactor(ci): switch release flow to PR-based bump with API-created tag#516
jack-edmonds-dd merged 1 commit into
mainfrom
refactor/release-pr-based

Conversation

@jack-edmonds-dd
Copy link
Copy Markdown
Collaborator

Summary

The previous release-prepare.yml pushed a version-bump commit directly to main and then pushed an annotated tag. Both steps are blocked under current DataDog org rulesets:

  • main requires PRs + signed commits + status checks (no direct pushes).
  • Tag creation is restricted to allowlisted apps per SECENG wiki 6360924697 (enforced since 2026-04-01), with dd-octo-sts being the recommended bypass actor.

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)

  • Drops environment: release (PR approval is now the gate).
  • Bumps Cargo.toml + refreshes Cargo.lock on the runner.
  • Uses the Git Data API (blob → tree → commit → ref) under a dd-octo-sts token to create a signed commit on a new release/v<X.Y.Z> branch — GitHub Apps sign commits made via the API, satisfying required_signatures once squashed onto main.
  • Opens a PR via gh pr create.

release-tag.yml (new) — creates the tag on PR merge

  • Triggered by pull_request: closed, gated by merged == true && startsWith(head_ref, 'release/') and same-repo PR head.
  • Uses dd-octo-sts (new release-tag policy, contents: write only) to create a lightweight tag via gh api repos/.../git/refs pointing 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.
  • Tag push triggers the existing release.yml (goreleaser) unchanged.

Trust policies

  • release.sts.yaml — subject reverted to repo:DataDog/pup:ref:refs/heads/main (no more environment: release), added pull_requests: write for gh pr create.
  • release-tag.sts.yaml (new) — scoped to release-tag.yml only via tight job_workflow_ref regex; contents: write only.

Test plan

  • Merge this PR.
  • Manually dispatch Prepare Release and confirm it opens a PR with the version bump (no direct push to main).
  • Approve and merge the resulting release PR.
  • Confirm release-tag.yml fires, creates the v<X.Y.Z> tag, and that the tag triggers release.yml.

🤖 Generated with Claude Code

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>
@jack-edmonds-dd jack-edmonds-dd requested a review from a team as a code owner May 20, 2026 14:11
@jack-edmonds-dd jack-edmonds-dd merged commit 4bf16f4 into main May 20, 2026
7 checks passed
@jack-edmonds-dd jack-edmonds-dd deleted the refactor/release-pr-based branch May 20, 2026 14:37
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