Repository navigation
ci: request the pub.dev OIDC token before publishing - #226
Merged
Merged
Conversation
bsneed
approved these changes
Nov 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The first tag-triggered publish (
segment_analytics-v2.0.0, run 41677577466) reacheddart pub publish --forcewith no credentials. Pub fell back to its interactive OAuth flow ("Pub needs your authorization… Waiting for your authorization…"), whoselocalhostcallback is on the runner, so the job hangs.dart pub publishdoes not request the GitHub OIDC token itself. pub.dev's example workflow usesdart-lang/setup-dart, whosecreatePubOIDCToken()requests an ID token for audiencehttps://pub.dev, exports it asPUB_TOKEN, and runsdart pub token add https://pub.dev --env-var PUB_TOKEN. Org policy admits onlyactions/*, and oursetup-flutteraction doesn't do this, so this PR does the same thing inline in the publish step:ACTIONS_ID_TOKEN_REQUEST_URLwithaudience=https://pub.dev(the job already hasid-token: write)dart pub token add, then publishtimeout-minutes: 15on the publish job, so any future credential problem fails fast instead of waiting for the 6h job limitRecovering 2.0.0
The
segment_analytics-v2.0.0tag points at the #224 merge commit, whosepublish.ymllacks this fix, so re-running that run won't help. After this merges, publish core withworkflow_dispatchfrommain(package: core). That is the re-run path in RELEASING.md and is enabled on pub.dev.mainthen contains exactly the 2.0.0 release plus this workflow change; the package contents are identical. The tag stays on the release commit.Testing
YAML parses, and the step mirrors
setup-dart'screatePubOIDCToken()(dart-lang/setup-dartlib/main.dart). The OIDC exchange itself can only be exercised by a real publish; the dispatch above is that test.