Skip to content

ci: publish only from tag refs; fix re-run docs - #227

Open
MichaelGHSeg wants to merge 1 commit into
mainfrom
ci/dispatch-from-tag
Open

MichaelGHSeg wants to merge 1 commit into
mainfrom
ci/dispatch-from-tag

Conversation

@MichaelGHSeg

Copy link
Copy Markdown
Contributor

Summary

Dispatching the publish workflow from main got past the OIDC exchange (#226), and then pub.dev rejected the token:

publishing is only allowed from 'tag' refType, this token has 'branch' refType

pub.dev's workflow_dispatch option only covers a dispatch run on a tag. The re-run path in RELEASING.md and in #226's description (dispatch from main with package: core) can never work. This PR:

  • check-release-metadata.sh: requires github.ref_type == tag and derives the package from the tag for both push and dispatch. A branch dispatch now fails in meta, before anyone is asked to approve, and says to use --ref <tag>.
  • publish.yml: drops the now-redundant package input and corrects the header comment.
  • RELEASING.md: re-run via the Actions tab or gh workflow run publish.yml --ref <tag> (uses the workflow as of the tag). If the commit or the workflow was wrong, recreate the tag on the fixed main, which is only safe while the version isn't on pub.dev. The production environment's deployment refs now name only the tag patterns, not main.

2.0.0 itself was recovered by recreating segment_analytics-v2.0.0 on main (release commit + #226).

Testing

Ran the script locally against origin/main:

  • tag segment_analytics-v2.0.0 → OK: segment_analytics 2.0.0
  • tag segment_analytics_plugin_idfa-v1.0.4 → OK
  • branch main → fails with the --ref <tag> hint
  • tag segment_analytics-v1.9.9 → version mismatch
  • tag segment_analytics_plugin_..-v1.0.0 → rejected

bash -n is clean and the workflow YAML parses.

pub.dev rejects OIDC tokens from branch refs, including workflow_dispatch
on main. Require a tag ref and derive the package from it for both
triggers, drop the package input, and correct RELEASING.md.
@MichaelGHSeg
MichaelGHSeg marked this pull request as ready for review November 3, 2026 17:53

This branch has not been deployed

No deployments
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.

2 participants