Skip to content

fix: use push event instead of pull_request for pub.dev OIDC auth - #293

Merged
marandaneto merged 3 commits into
mainfrom
fix/publish-oidc-push-event
Feb 19, 2026
Merged

marandaneto merged 3 commits into
mainfrom
fix/publish-oidc-push-event

Conversation

@marandaneto

@marandaneto marandaneto commented Feb 19, 2026 •

Copy link
Copy Markdown
Member

Problem

#skip-changelog

The Publish to pub.dev step fails with:

publishing is only allowed from 'push' or 'workflow_dispatch' events, this token originates from a 'pull_request' event.

pub.dev's trusted publishing rejects OIDC tokens from pull_request events.

Fix

  • Changed the workflow trigger from pull_request: types: [closed] to push: branches: [main]
  • Added a new step that uses the GitHub API to find the PR associated with the merge commit and verify it has the release label
  • Gated checkout and changeset checks behind the release label check

This preserves the original behavior (only release when a PR with the release label is merged) while ensuring the OIDC token comes from a push event, which pub.dev requires.

pub.dev trusted publishing only allows OIDC tokens from 'push' or
'workflow_dispatch' events, not 'pull_request'. Changed the trigger
to 'push' on main and added a step to check for the 'release' label
on the associated merged PR via the GitHub API.
@marandaneto
marandaneto requested a review from a team as a code owner February 19, 2026 10:21
@marandaneto
marandaneto requested a review from a team February 19, 2026 10:27
@marandaneto
marandaneto enabled auto-merge (squash) February 19, 2026 10:27
@marandaneto
marandaneto merged commit fe383a5 into main Feb 19, 2026
16 checks passed
@marandaneto
marandaneto deleted the fix/publish-oidc-push-event branch February 19, 2026 10:46
@marandaneto
marandaneto restored the fix/publish-oidc-push-event branch February 19, 2026 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants