Skip to content

fix: Scope publish approvals to target repositories - #9693

Merged
BYK merged 1 commit into
mainfrom
fix-9355-target-repo-approvals
Oct 1, 2026
Merged

BYK merged 1 commit into
mainfrom
fix-9355-target-repo-approvals

Conversation

@BYK

@BYK BYK commented Sep 28, 2026 •

Copy link
Copy Markdown
Member

Summary

  • authorize each accepted transition against the exact target repository and publish path
  • preserve allowlisted Internal App approvals while rejecting arbitrary bots and unauthorized users
  • revalidate the request, security labels, approver, and event target before ci-ready and target checkout
  • revoke stranded accepted, ci-pending, and ci-ready state with verified retries

Test plan

  • yarn test --printConsoleTrace (17 files, 125 tests)
  • yarn lint
  • Prettier check for all changed files
  • parse all workflow YAML with the checked-in yaml package
  • git diff --check

Fixes #9355

@BYK
BYK requested a review from a team as a code owner September 28, 2026 18:28
@BYK
BYK requested a review from Jeffreyhung September 28, 2026 18:34
@BYK
BYK merged commit 393db54 into main Oct 1, 2026
14 checks passed
@BYK
BYK deleted the fix-9355-target-repo-approvals branch October 1, 2026 16:13
BYK pushed a commit that referenced this pull request Oct 6, 2026
#9693 rejects `accepted` labels from every `[bot]` account except
`sentry-internal-app[bot]`. That broke Junior's release flow: on #9771,
`sentry-junior[bot]` added `accepted` and the workflow removed it, so a
human had to approve the release by hand.

This adds an allowlist of trusted Sentry-operated release bots, which
can approve any valid getsentry publish target. For now
`sentry-junior[bot]` is the only entry. Other bots are still rejected,
and malformed repos or publish paths still fail before the allowlist is
checked. The rest of #9693 stays as-is: per-target authorization for
humans, revalidation before `ci-ready`, and revoking stranded labels.
Every approval check (`publish.yml` and `ci-poller.yml`) goes through
`authorizeApproval`, so all of them pick up the allowlist.

Refs #9772

<!-- junior-request-attribution:start -->
via **David Cramer**.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:slack%3AG6MCDB51U%3A1791237467.400049 -->

--

[View Junior
Session](https://junior-prod.sentry.dev/conversations/slack%3AG6MCDB51U%3A1791237467.400049)
[[Sentry]](https://sentry.sentry.io/explore/conversations/slack%3AG6MCDB51U%3A1791237467.400049/?project=4510944073809921)

<!-- junior-session-footer:end -->

---------

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
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.

Use security-as-code to gate approver validity

2 participants