Skip to content

ci: pass DOWNSTREAM_DISPATCH_TOKEN through workflow_call to release.yml#2324

Merged
bpamiri merged 1 commit intodevelopfrom
ci/passthrough-dispatch-token-via-workflow-call
Apr 27, 2026
Merged

ci: pass DOWNSTREAM_DISPATCH_TOKEN through workflow_call to release.yml#2324
bpamiri merged 1 commit intodevelopfrom
ci/passthrough-dispatch-token-via-workflow-call

Conversation

@bpamiri
Copy link
Copy Markdown
Collaborator

@bpamiri bpamiri commented Apr 27, 2026

Summary

Hot-fix for #2320. The dispatch step landed correctly, but it can't see the secret when `release.yml` is invoked via `workflow_call` from `snapshot.yml` (which is what happens on every push to `develop`). `workflow_call` requires:

  1. Explicit declaration on the callee (`release.yml`'s `workflow_call.secrets` block)
  2. Explicit passthrough from the caller (`snapshot.yml`'s `secrets:` block)

Without both, `secrets.DOWNSTREAM_DISPATCH_TOKEN` evaluates to empty inside `release.yml` regardless of whether the repo actually has the secret set.

Symptom

The `develop` push for #2321 (merge SHA `4fd8dc9`) ran successfully end-to-end. Snapshot release was published, but the dispatch step printed:

```
##[warning]DOWNSTREAM_DISPATCH_TOKEN is not set on the repository
— homebrew/chocolatey auto-update will fall back to the daily cron tick.
```

…even though `gh secret list --repo wheels-dev/wheels` confirms the secret was set 7 minutes earlier at `2026-04-27T01:22:19Z`.

Fix

7 lines:

  • `release.yml`: add `DOWNSTREAM_DISPATCH_TOKEN: required: false` to `workflow_call.secrets`
  • `snapshot.yml`: add `DOWNSTREAM_DISPATCH_TOKEN: ${{ secrets.DOWNSTREAM_DISPATCH_TOKEN }}` to the `secrets:` block of the `build` job

The secret is declared optional because the dispatch step still exits 0 when it's missing — releases are never blocked.

Verification

After merge, the next `develop` push will trigger snapshot.yml → release.yml with the token visible. Confirm by:

```bash
gh run view --repo wheels-dev/wheels --log | grep -E "Dispatching|workflows dispatched|::warning"
```

A successful run shows `Dispatching wheels-released to wheels-dev/homebrew-wheels...` followed by `✓ homebrew-wheels dispatched` etc.

Why this wasn't caught in #2320 review

The `workflow_call` secret-passthrough requirement is one of those GitHub Actions footguns that only manifests at runtime (no schema validation flags it). The release.yml change worked locally and in tests against `main` (where it'd be triggered by direct push, not workflow_call), and `gh actionlint` doesn't check workflow_call secret coverage.

🤖 Generated with Claude Code

The release.yml workflow runs in two modes:
1. Push to main — secrets are inherited from the workflow run
2. workflow_call from snapshot.yml — secrets must be explicitly declared
   on the callee and explicitly passed through on the caller

#2320 added the dispatch step + read of secrets.DOWNSTREAM_DISPATCH_TOKEN
but only handled mode 1. In mode 2 (which is what snapshot.yml does on
every develop push) the secret is invisible regardless of whether the
repo has it set, so the dispatch step always hits its graceful-degrade
warning branch.

Fix is a 7-line passthrough: declare the secret as optional in the
workflow_call.secrets block of release.yml, then pass it through from
snapshot.yml. Since the step exits 0 when the secret is missing, no
release ever breaks if the secret is unset — this just makes the secret
actually visible when it IS set.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@bpamiri bpamiri merged commit eeb44f1 into develop Apr 27, 2026
3 checks passed
@bpamiri bpamiri deleted the ci/passthrough-dispatch-token-via-workflow-call branch April 27, 2026 01:57
bpamiri added a commit that referenced this pull request Apr 27, 2026
Empty commit to fire snapshot.yml -> release.yml -> repository_dispatch
to homebrew-wheels and chocolatey-wheels. Tests:

  - DOWNSTREAM_DISPATCH_TOKEN with corrected Contents:write scope
  - workflow_call secret passthrough (#2324)
  - AUTO_MERGE_PAT propagating events on both downstream repos
  - choco publish-on-merge firing automatically after auto-update merge

Expected: ~15-20 min for the full chain to complete with no manual
nudges. Resulting wheels v0.3.7.<runNumber> on community.chocolatey.org.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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