Skip to content

ci(release): pin publish job to a named environment and tag refs - #58

Merged
yakimoto merged 1 commit into
mainfrom
ci/release-environment
Sep 12, 2026
Merged

yakimoto merged 1 commit into
mainfrom
ci/release-environment

Conversation

@yakimoto

@yakimoto yakimoto commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

User description

What this changes

One job in .github/workflows/release.yml — publish, the only job in the pipeline that mints a short-lived OIDC identity and hands it to a package registry. Two lines of behaviour, no change to what gets built, tested, or uploaded.

1. A ref floor on the credential-minting job. The publish job now carries an if: guard and runs only when one of three things is true: the run is a v* tag push, the run is a published release, or the run is a workflow_dispatch from the default branch. Anything else — a dispatch from a feature branch, a fork branch, a scratch branch — stops at this job instead of requesting the environment and reaching the registry.

2. A comment making the existing environment and permission scoping non-accidental. The named environment and the job-scoped id-token: write were already correct here; they are now documented as load-bearing so a future edit does not hoist the mint to the workflow level or drop the environment name that the registry-side publisher configuration is pinned to.

Why the ref guard is not redundant with the checks already here

The resolve-ref job already does real work: it validates the tag against a full-anchored v<semver> regex, proves the tag resolves to a real commit object, and requires that commit to be an ancestor of origin/main. That chain guarantees the code this pipeline publishes was merged and reviewed on the default branch. It deliberately says nothing about the run's own ref.

That distinction matters, because the run's ref is not inert. It is the value that lands in the ref claim of the OIDC token the runner mints, and it is what scopes the run's Actions cache. A workflow_dispatch triggered from an arbitrary branch would previously have satisfied every existing check — the tag it names is still ancestry-verified — while minting a publishing credential under that branch's identity and running inside that branch's cache scope. The guard closes exactly that gap and nothing else.

Why the third clause exists

A strict refs/tags/v*-only guard would have been simpler and wrong. This workflow has a deliberate, documented idempotent-backfill path: an operator dispatches it from the default branch naming an already-shipped tag, and the pipeline re-runs without re-publishing (the registry-version check already no-ops the upload for a version that exists). Dropping that path to satisfy a tidier condition would have traded a working operational capability for a cosmetic one. The default-branch clause keeps the backfill and still excludes every other branch; the ancestry check continues to anchor which tree that dispatch may act on.

The clause is also written to fail closed: format('refs/heads/{0}', github.event.repository.default_branch) yields refs/heads/ if the payload ever lacks default_branch, and that matches no real ref — so an unexpected event shape denies the publish rather than admitting it.

Verification

Actions runs are not currently executing on this organisation, so this was verified locally rather than by a green check on this PR:

  • actionlint .github/workflows/release.yml — exit 0, no findings.
  • The workflow parses as YAML and the resulting job graph is unchanged: resolve-ref, verify, publish, sbom, release.
  • Parsed publish job asserts, post-change: environment = pypi, permissions = {id-token: write, contents: read}, workflow-level permissions = {contents: read}.
  • Diff is additive only: 21 lines, one file, no deletions.

Operator follow-up, not in this PR

This PR changes workflow files only. Naming an environment does not create it or protect it — that is repository configuration and is left entirely to a maintainer. Until the environment exists with a required reviewer and a tag-scoped deployment policy, and until the registry-side publisher is pinned to the same environment name, the if: guard above is the active control and the environment name is a declaration awaiting its other half.

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.


Note

Medium Risk
Changes release pipeline authorization for PyPI OIDC publishing; misconfigured conditions could block legitimate backfills or leave a gap if expressions are wrong, though the intent is fail-closed.

Overview
Tightens who can mint PyPI publishing credentials in the release workflow by adding a job-level if: on publish. That job now runs only for v* tag pushes, published GitHub releases, or workflow_dispatch from the default branch—blocking dispatches from feature or fork branches that could still pass tag ancestry checks while putting the run’s OIDC ref and Actions cache under an untrusted branch identity.

The diff is otherwise comment-only documentation around the existing pypi environment and job-scoped id-token: write, so future edits don’t hoist OIDC minting to workflow scope or drop the environment name PyPI Trusted Publishing expects.

Reviewed by Cursor Bugbot for commit 9947140. Bugbot is set up for automated code reviews on this repo. Configure here.

Summary by Sourcery

Harden the release workflow by limiting publishing credentials to approved refs while preserving the default-branch backfill path.

Enhancements:

  • Restrict the PyPI publishing job to tag pushes, published releases, and default-branch manual dispatches.
  • Document the publish job’s named environment and job-scoped OIDC permissions as required security boundaries.

CI:

  • Add a fail-closed ref guard to prevent publishing credentials from being minted for arbitrary branches.

Review in cubic


CodeAnt-AI Description

Restrict PyPI publishing to approved release refs and environment controls

What Changed

  • PyPI publishing now runs only for version tag pushes, published releases, or manual runs from the default branch
  • Publishing is tied to the pypi environment so its configured protection rules and registry trust settings can gate credential issuance
  • The publishing credential remains limited to the publish job instead of being available to the whole workflow

Impact

✅ Fewer accidental PyPI publications
✅ Release credentials limited to approved refs
✅ Environment review gates protected publishing

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

The publish job is the only job that mints a short-lived OIDC identity and
exchanges it for a registry publish credential. Declare a named environment on
that job so the registry-side trusted publisher and a repository environment
protection rule have something to pin to, and add an if: guard so the job runs
only from a release tag push, a published release, or a default-branch dispatch
(the documented idempotent backfill path) -- never from an arbitrary branch.

The existing resolve-ref job validates the TAG (shape, existence, ancestry to
origin/main), which governs the code that gets published. It says nothing about
the run own ref, which is what lands in the OIDC token ref claim and scopes the
run Actions cache. This guard closes that gap. id-token: write stays scoped to
this job only; the workflow-level default remains contents: read.

Verified locally (org Actions runs are not executing): actionlint exit 0, YAML
parses, job graph unchanged, additive diff only.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@qodo-code-review

Copy link
Copy Markdown

ⓘ Qodo reviews are paused because your workspace is out of credits. Ask your workspace admin to add credits to resume reviews. Manage billing

@codeant-ai

codeant-ai Bot commented Sep 12, 2026 •

Copy link
Copy Markdown

🤖 CodeAnt AI — Review Status

Status Commit Started (UTC) Finished (UTC)
✅ Reviewed your PR 9947140 Sep 12, 2026 · 17:22 17:24

@sourcery-ai

sourcery-ai Bot commented Sep 12, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

The release workflow now prevents the OIDC credential-minting publish job from running on arbitrary branch refs, while retaining tag and default-branch backfill workflows. It also documents the existing job-scoped pypi environment and id-token: write permission boundaries that must remain aligned with repository and registry configuration.

Flow diagram for guarded publish job

flowchart TD
    A[Release workflow event] --> B{publish if guard}
    B -->|v* tag push| C[resolve-ref and verify]
    B -->|published release| C
    B -->|workflow dispatch from default branch| C
    B -->|other branch or ref| X[Publish job skipped]
    C --> D[Publish job]
    D --> E[pypi environment]
    E --> F[OIDC token with id-token write]
    F --> G[PyPI publish]
Loading

File-Level Changes

Change Details Files
Restrict the credential-minting publish job to trusted run refs while preserving the documented backfill path.
  • Allow publishing only for version tag pushes, published releases, or manual dispatches from the repository default branch.
  • Keep existing tag validation and ancestry checks as the code-integrity controls, while adding a guard for the run’s own ref and associated OIDC/cache scope.
  • Fail closed when the event payload lacks a usable default branch.
.github/workflows/release.yml
Document and preserve the job-level environment and OIDC permission boundaries required for registry publishing.
  • Clarify that the publish job’s named pypi environment is required for registry trusted-publisher identity and environment protection.
  • Keep id-token: write scoped exclusively to the publish job, with workflow-level permissions remaining read-only.
  • Call out that environment creation, reviewer requirements, tag policy, and registry configuration remain operator responsibilities.
.github/workflows/release.yml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@codeant-ai

codeant-ai Bot commented Sep 12, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@cursor

cursor Bot commented Sep 12, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_e7897477-2316-4872-8354-0cd10e89ef6b)

@coderabbitai

coderabbitai Bot commented Sep 12, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 09295e35-eefe-4e02-8058-8bcd5dc4799c

📥 Commits

Reviewing files that changed from the base of the PR and between 4074204 and 9947140.

📒 Files selected for processing (1)
  • .github/workflows/release.yml

Included review availability: 6 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 10 reviews per hour.

📜 Recent review details
⏰ Context from checks skipped due to timeout. (5)
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: cubic · AI code reviewer
  • GitHub Check: Sourcery review
  • GitHub Check: Gitar
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (1)
.github/workflows/release.yml (1)

288-288: 🩺 Stability & Availability

The workflow permits default-branch dispatches, and GitHub matches environment deployment rules against GITHUB_REF. However, the repository does not expose the actual pypi environment configuration, so it is not possible to determine whether that environment allows the default branch or only v* tags.


📝 Summary

Summary by CodeRabbit

  • Chores
    • Updated release publishing to run only for version tags, release events, or approved manual workflow runs.
    • Added safeguards and documentation around PyPI publishing permissions and environment protection.

Walkthrough

The release workflow now limits the credential-minting publish job to version-tag pushes, release events, or default-branch dispatches. It documents the PyPI OIDC trusted-publisher and protection-rule requirements.

Changes

Release publishing controls

Layer / File(s) Summary
Publish job execution guard
.github/workflows/release.yml
The publish job runs only for approved trigger contexts. The PyPI environment and id-token: write permission remain scoped to the job, with documentation for trusted-publisher and protection-rule requirements.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 99471

The publish guard restricts credential issuance to the intended release contexts, and the permitted default-branch dispatch remains usable.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the release workflow and its main security changes: named environment use and ref restrictions for the publish job.
Description check ✅ Passed The description directly explains the publish-job guard, OIDC permission scope, named environment, backfill path, and local verification.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/release-environment
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch ci/release-environment

Comment @coderabbitai help to get the list of available commands.

@codeant-ai codeant-ai Bot added the size:S This PR changes 10-29 lines, ignoring generated files label Sep 12, 2026
@macroscopeapp

macroscopeapp Bot commented Sep 12, 2026

Copy link
Copy Markdown

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — The change restricts PyPI publishing credentials to approved refs, altering the authorization boundary for production package publication while leaving normal SDK runtime behavior unchanged. Its release and OIDC implications warrant focused human review despite the narrow, owner-authored diff.

Not approved because:

  • Credit balance exhausted. Approvability relies on correctness review in order to determine eligibility

Review your spending limits in Billing settings. You can add or adjust custom eligibility rules. Learn more.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!

Sourcery assessment

Needs a human reviewer. This changes the authorization and trust boundary for minting a PyPI publishing credential: a condition or environment/OIDC mismatch could let an unapproved ref publish a package. Reverting would stop future unauthorized runs, but any package already published under the wrong authorization would remain externally visible and require remediation.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

if: >-
startsWith(github.ref, 'refs/tags/v')
|| github.event_name == 'release'
|| github.ref == format('refs/heads/{0}', github.event.repository.default_branch)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: A dispatch from main passes this guard, but the documented tag-only pypi environment policy rejects that branch ref before publishing, breaking the backfill path. [api mismatch]

Assessment: 🟠 Major · 🔁 Occurrence: Sometimes

Use CodeAnt Skill Fix in Cursor Fix in VSCode Claude

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** .github/workflows/release.yml
**Line:** 282:282
**Comment:**
	*Api Mismatch: A dispatch from `main` passes this guard, but the documented tag-only `pypi` environment policy rejects that branch ref before publishing, breaking the backfill path.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
👍 | 👎

@gitar-bot

gitar-bot Bot commented Sep 12, 2026

Copy link
Copy Markdown

Note

Automatic reviews are paused because your team has used its included automatic processing for this billing period (headroom scales with your seat count). You can still comment "Gitar review" to run one anytime, and automatic reviews resume on their own by October 1. Add seats for more headroom.
Learn more

Code Review ✅ Approved

Adds a ref guard to the publish job in the release workflow, restricting PyPI credential minting to v* tag pushes, published releases, and workflow_dispatch from the default branch. Closes a gap where arbitrary-branch dispatches could mint publishing credentials under an untrusted branch identity while still passing tag ancestry checks. Documentation comments preserve the existing pypi environment and job-scoped id-token: write as load-bearing security boundaries. No issues found.

Options

Display: compact → Counting what did not apply, without listing it.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 1 file

Confidence score: 3/5

  • In .github/workflows/release.yml, the branch condition allows a default-branch dispatch to reach the publish job, but the tag-only pypi environment blocks it before publishing, so the documented backfill path cannot work; make the dispatch path compatible with the environment protection or revise the documented procedure.
  • The github.event_name == 'release' condition in .github/workflows/release.yml is unreachable because the workflow only triggers on tag pushes and workflow_dispatch; remove the dead clause or add the corresponding event trigger.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name=".github/workflows/release.yml">

<violation number="1" location=".github/workflows/release.yml:281">
P2: The `github.event_name == 'release'` clause is dead: this workflow's `on:` block (lines 70-73) only triggers on tag pushes and `workflow_dispatch` — no `release` event trigger exists, so A `release` event can never start this run and the clause can never be true. The added guard comment and the PR description both claim a "published release" is a supported publish path, which is misleading. If release-event triggering is intended, add `on: release: types: [published]` and gate the job on `github.event.action == 'published'`; if not, remove the clause and the 'published release' claim. Note that default `on: release` types are `published`, `created`, `edited`, `deleted`, `unpublished`, `prereleased` — a future add without an explicit `types:` list would let this broad clause pass the id-token:write guard on release deletion/edits, the opposite of this PR's fail-closed intent.</violation>

<violation number="2" location=".github/workflows/release.yml:282">
P1: When the `pypi` environment allows only tag deployments, this branch clause lets a default-branch dispatch reach the job but environment protection blocks it before publishing, so the documented backfill path cannot work. Allow the default branch in the `pypi` environment deployment policy.</violation>
</file>
Architecture diagram
sequenceDiagram
    participant GH as GitHub Events
    participant WF as Release Workflow
    participant RR as resolve-ref Job
    participant V as verify Job
    participant P as publish Job
    participant ENV as pypi Environment
    participant OIDC as GitHub OIDC Provider
    participant ACT as Actions Cache
    participant PYPI as PyPI Trusted Publisher

    Note over GH,PYPI: Current-State Release Pipeline Security Model

    GH->>WF: Trigger workflow run
    WF->>RR: Run resolve-ref job
    RR->>RR: Validate tag is v<semver>
    RR->>RR: Verify tag resolves to commit
    RR->>RR: Confirm commit is ancestor of origin/main
    
    alt Tag validation fails
        RR-->>WF: Skip downstream jobs
    else Tag validation succeeds
        RR-->>V: Pass validated tag info
        V->>V: Run verification checks
        V-->>P: Trigger publish job
    end

    Note over P: Ref guard on publish job
    
    alt v* tag push (github.ref startsWith refs/tags/v)
        P->>ENV: Request pypi environment
    else Published release event
        P->>ENV: Request pypi environment
    else workflow_dispatch from default branch
        P->>ENV: Request pypi environment
    else Other branch dispatch
        P-->>WF: Job skipped - no credential minted
    end

    Note over P,ENV: Environment protection gate
    
    alt Environment protection rules pass
        ENV-->>P: Grant environment access
        P->>OIDC: Requestid-token (job-scoped write)
        OIDC-->>P: Mint token with run's ref claim
        P->>ACT: Access branch-scoped cache
        P->>PYPI: Publish package with OIDC token
        PYPI-->>P: Confirm publication
    else Protection rules deny
        ENV-->>P: Block credential minting
    end
Loading

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

if: >-
startsWith(github.ref, 'refs/tags/v')
|| github.event_name == 'release'
|| github.ref == format('refs/heads/{0}', github.event.repository.default_branch)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: When the pypi environment allows only tag deployments, this branch clause lets a default-branch dispatch reach the job but environment protection blocks it before publishing, so the documented backfill path cannot work. Allow the default branch in the pypi environment deployment policy.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/workflows/release.yml, line 282:

<comment>When the `pypi` environment allows only tag deployments, this branch clause lets a default-branch dispatch reach the job but environment protection blocks it before publishing, so the documented backfill path cannot work. Allow the default branch in the `pypi` environment deployment policy.</comment>

<file context>
@@ -266,11 +266,32 @@ jobs:
+    if: >-
+      startsWith(github.ref, 'refs/tags/v')
+      || github.event_name == 'release'
+      || github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
     runs-on: ubuntu-latest
     timeout-minutes: 10
</file context>

# `refs/heads/`, matching no real ref, so the guard fails CLOSED.
if: >-
startsWith(github.ref, 'refs/tags/v')
|| github.event_name == 'release'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: The github.event_name == 'release' clause is dead: this workflow's on: block (lines 70-73) only triggers on tag pushes and workflow_dispatch — no release event trigger exists, so A release event can never start this run and the clause can never be true. The added guard comment and the PR description both claim a "published release" is a supported publish path, which is misleading. If release-event triggering is intended, add on: release: types: [published] and gate the job on github.event.action == 'published'; if not, remove the clause and the 'published release' claim. Note that default on: release types are published, created, edited, deleted, unpublished, prereleased — a future add without an explicit types: list would let this broad clause pass the id-token:write guard on release deletion/edits, the opposite of this PR's fail-closed intent.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/workflows/release.yml, line 281:

<comment>The `github.event_name == 'release'` clause is dead: this workflow's `on:` block (lines 70-73) only triggers on tag pushes and `workflow_dispatch` — no `release` event trigger exists, so A `release` event can never start this run and the clause can never be true. The added guard comment and the PR description both claim a "published release" is a supported publish path, which is misleading. If release-event triggering is intended, add `on: release: types: [published]` and gate the job on `github.event.action == 'published'`; if not, remove the clause and the 'published release' claim. Note that default `on: release` types are `published`, `created`, `edited`, `deleted`, `unpublished`, `prereleased` — a future add without an explicit `types:` list would let this broad clause pass the id-token:write guard on release deletion/edits, the opposite of this PR's fail-closed intent.</comment>

<file context>
@@ -266,11 +266,32 @@ jobs:
+    # `refs/heads/`, matching no real ref, so the guard fails CLOSED.
+    if: >-
+      startsWith(github.ref, 'refs/tags/v')
+      || github.event_name == 'release'
+      || github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
     runs-on: ubuntu-latest
</file context>

@yakimoto
yakimoto merged commit ef95f51 into main Sep 12, 2026
14 of 29 checks passed
@yakimoto
yakimoto deleted the ci/release-environment branch September 12, 2026 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S This PR changes 10-29 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant