Skip to content

fix: switch release workflow trigger to push to fix octo-sts OIDC mismatch#513

Merged
michael-richey merged 1 commit intomainfrom
fix/release-workflow-oidc
Apr 7, 2026
Merged

fix: switch release workflow trigger to push to fix octo-sts OIDC mismatch#513
michael-richey merged 1 commit intomainfrom
fix/release-workflow-oidc

Conversation

@michael-richey
Copy link
Copy Markdown
Collaborator

Summary

  • The pull_request: types: [closed] trigger sets the OIDC token sub to repo:DataDog/datadog-sync-cli:pull_request, which does not match the self.release.create-release trust policy requiring repo:DataDog/datadog-sync-cli:ref:refs/heads/main
  • This caused a 403 on every release attempt (e.g. run 24088623315)
  • Switching to push: branches: [main] sets the correct subject
  • A Detect release step using listPullRequestsAssociatedWithCommit recovers the PR context (branch name, release guard) that is unavailable in push events

Changes

  • Trigger changed from pull_request: types: [closed] to push: branches: [main]
  • Added concurrency group to prevent run stacking
  • Added pull-requests: read permission for the detect step
  • Added Detect release step with error handling and sorted results
  • create_release job now exposes outputs (is_release, release_branch) consumed by build_artifacts
  • github.head_ref replaced with step/job outputs throughout
  • context.payload.pull_request.merge_commit_sha replaced with context.sha

Test plan

  • Merge a non-release PR to main → create_release job runs, detect step skips, build_artifacts skipped
  • Trigger a release via prepare_release.yml and merge → full release flow executes, no more octo-sts 403

🤖 Generated with Claude Code

…ject mismatch

The pull_request trigger sets OIDC sub to
repo:DataDog/datadog-sync-cli:pull_request, which does not match the
self.release.create-release trust policy requiring ref:refs/heads/main.

Switching to a push trigger fixes the subject. A detect_release step
recovers the PR context (branch name, release guard) lost by moving away
from the pull_request event.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@michael-richey michael-richey merged commit 39a7cbb into main Apr 7, 2026
13 of 14 checks passed
@michael-richey michael-richey deleted the fix/release-workflow-oidc branch April 7, 2026 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants