Skip to content

ci: call the registry dispatch from publish.yml instead of a trigger that cannot fire - #181

Open
anilcancakir wants to merge 1 commit into
masterfrom
fix/registry-dispatch-cannot-fire
Open

ci: call the registry dispatch from publish.yml instead of a trigger that cannot fire#181
anilcancakir wants to merge 1 commit into
masterfrom
fix/registry-dispatch-cannot-fire

Conversation

@anilcancakir

Copy link
Copy Markdown
Collaborator

What

publish.yml calls dispatch-to-registry.yml directly after its github-release job. The release: [published] trigger that workflow used to declare is gone, replaced by workflow_call; workflow_dispatch stays as the manual escape hatch.

Why

The trigger could never fire, and 1.4.0 proved it.

dispatch-to-registry.yml listened for release: [published]. The release is created inside publish.yml's github-release job:

env:
  GH_TOKEN: ${{ github.token }}
run: gh release create "$VERSION" ...

GitHub does not start new workflow runs from events raised by GITHUB_TOKEN. The trigger was added on 2026-08-03 and 1.4.0 (2026-08-21) was the first release after it, so it had exactly one chance:

$ gh run list --workflow "dispatch-to-registry.yml" --limit 2
30859849469 workflow_dispatch completed/success 2026-08-03T22:45:30Z
30822132338 push             completed/success 2026-08-03T14:19:19Z

Nothing since. Both of those are the manual run and the retired push trigger, so the release path has never fired once. The 1.4.0 skill (2.12.0, plus the nine reference titles moved to the 1.4 line) reached fluttersdk/ai only because it was dispatched by hand after the release.

The shape of the failure is what makes it worth fixing rather than working around: publish.yml goes green either way, dispatch-to-registry.yml simply never appears, and the only symptom is end users running npx skills add fluttersdk/ai --skill wind-ui and getting a skill one release behind. There is nothing red to notice.

Why a call and not a different trigger

Adding push: tags to the dispatch workflow would also have fired, since a human tag push does trigger workflows. It was rejected because it runs in parallel with publish.yml: the registry would be told about a version before pub.dev had accepted it, and if the publish job failed the registry would be ahead of the package. needs: github-release gets the ordering for free and removes the cross-workflow event entirely, which is the part that was fragile.

Secrets

Passed by name rather than secrets: inherit. The called workflow needs exactly REGISTRY_BOT_APP_ID and REGISTRY_BOT_PRIVATE_KEY, both now declared required: true under workflow_call.secrets, and handing it the whole secret store would sit badly in a repo that pins every action by SHA and runs zizmor plus scorecard over the result. Verified that the names declared on the callee match the names passed by the caller.

Second bug in the same file

The version-extraction step tested the ref against ^v[0-9]+\.[0-9]+\.[0-9]+, but this repo tags without the v prefix: publish.yml matches [0-9]+.[0-9]+.[0-9]+* and CLAUDE.md says git tag X.Y.Z. So that branch could never match a real tag and every run fell through to reading pubspec.yaml. The fallback happens to give the right answer on master after a release bump, which is why it never surfaced. Now ^v?, with the existing ${GITHUB_REF_NAME#v} strip left in place since it is a no-op when there is no prefix.

Verification

actionlint needs Docker, which is not available on this machine, so it was not run locally; the Workflows lint job runs it on this PR. Locally I verified both files parse and that the call interface lines up on both sides:

publish.yml jobs: ['validate', 'publish', 'github-release', 'registry']
registry job: needs=github-release uses=./.github/workflows/dispatch-to-registry.yml
dispatch-to-registry.yml on: ['workflow_call', 'workflow_dispatch']
callee secrets == caller secrets: True

This PR touches .github/workflows/**, so zizmor SAST actually reports here, unlike a lib/-only PR.

Other gates, unchanged by a workflow edit but run anyway: dart format 0 changed, dart analyze no issues, flutter test 1698 passed 1 skipped, check-docs.py 0 issues.

What this cannot verify

The fix only proves itself on the next real release, since workflow_call runs only when publish.yml runs. Until then the manual gh workflow run dispatch-to-registry.yml --ref master remains the way to push a skill fix out between releases, and that path is untouched.

…that cannot fire

`dispatch-to-registry.yml` declared `release: [published]`, but the release is
created inside publish.yml's github-release job by `gh release create` under
`GH_TOKEN: ${{ github.token }}`, and GitHub does not start workflow runs from
events raised by GITHUB_TOKEN. The trigger was added on 2026-08-03 and 1.4.0
was the first release after it, so it had one chance and missed: the run
history held nothing since 2026-08-03, and both entries there were
workflow_dispatch and the retired push trigger. The 1.4.0 skill reached
fluttersdk/ai only because it was dispatched by hand.

The failure is silent, which is the part worth fixing. The publish workflow
goes green either way and the only symptom is end users installing a skill one
version behind.

publish.yml now calls the workflow with `needs: github-release`. That removes
the cross-workflow event and also sequences the dispatch after pub.dev has
accepted the release rather than alongside it. The dead `release` trigger is
replaced by `workflow_call`; `workflow_dispatch` stays as the manual hatch.

Secrets are named rather than inherited: the called workflow needs exactly
two, and handing it the whole store would sit badly in a repo that pins every
action by SHA and runs zizmor over the result.

Also fixes the version-extraction guard in the same file. It tested the ref
against `^v[0-9]+\.[0-9]+\.[0-9]+`, but this repo tags without the prefix
(publish.yml matches '[0-9]+.[0-9]+.[0-9]+*'), so that branch never matched a
real tag and always fell through to pubspec.yaml. The fallback is correct on
master after a release bump, which is why it went unnoticed.
@coderabbitai

coderabbitai Bot commented Aug 21, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@anilcancakir, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 57 minutes

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

Wait for the limit to reset, then comment @coderabbitai review or push new commits to the PR.

An organization admin can change what happens after included review limits in Billing.

How do review limits work?

CodeRabbit enforces per-developer PR review limits within each organization.

For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 82355d7d-84dc-4fad-ab29-8e310c1fc803

📥 Commits

Reviewing files that changed from the base of the PR and between af36b8c and f7a1465.

📒 Files selected for processing (3)
  • .github/workflows/dispatch-to-registry.yml
  • .github/workflows/publish.yml
  • CHANGELOG.md

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@codecov

codecov Bot commented Aug 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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.

1 participant