Skip to content

feat(workflows): add reusable _dispatch-flake-consumers workflow#21

Merged
JacobPEvans-personal merged 1 commit into
mainfrom
feat/dispatch-flake-consumers
Jun 2, 2026
Merged

feat(workflows): add reusable _dispatch-flake-consumers workflow#21
JacobPEvans-personal merged 1 commit into
mainfrom
feat/dispatch-flake-consumers

Conversation

@JacobPEvans-personal
Copy link
Copy Markdown
Member

Summary

  • Adds _dispatch-flake-consumers.yml — a reusable workflow_call workflow that encapsulates the matrix fan-out, App-token mint, and cross-repo repository_dispatch call that every upstream flake-release sender needs
  • Each consuming repo replaces a duplicated ~41-line job with a 3-line uses: caller; all logic lives here
  • Mirrors _update-flake-input.yml conventions: @v3 create-github-app-token, vars.GH_APP_CLIENT_ID / GH_APP_PRIVATE_KEY, env-var injection guards, permissions: {} + job-level contents: read
  • Uses ${GITHUB_REPOSITORY_OWNER} instead of a hardcoded dryvist
  • source_input defaults to github.event.repository.name so callers need no with: block
  • permission-contents: write is now enforced centrally (nix-ai's sender was previously omitting it)

Context

Part of the event-driven flake-lock propagation chain:

nix-claude-code release → dispatch → nix-ai → push flake.lock → dispatch → nix-darwin

The receiver side was already centralized via _update-flake-input.yml (#20). This PR does the same for the sender side.

Must merge before the caller PRs:

Test Plan

  • zizmor passes (min-privilege: permissions: {} top-level, contents: read at job, scoped App token with permission-contents: write only for the target repo)
  • Pre-commit / workflow lint clean
  • After merge: confirm nix-claude-code#44 and nix-ai#869 CI passes against @main

🤖 Generated with Claude Code

Centralises the flake-consumer dispatch sender so every upstream repo
that needs to notify downstream consumers on a release (or flake.lock
push) can use a ~9-line caller instead of duplicating the full 41-line
token-mint + matrix-dispatch job.

Mirrors the conventions of the sibling _update-flake-input.yml:
- @V3 create-github-app-token, vars.GH_APP_CLIENT_ID / GH_APP_PRIVATE_KEY
- env-var injection guards on all run: steps
- permissions: {} at top level, contents:read at job level
- uses ${GITHUB_REPOSITORY_OWNER} instead of a hardcoded org name

vars.DISPATCH_CONSUMERS and vars.GH_APP_CLIENT_ID resolve in the caller's
context (workflow_call inherits caller vars), so they are read directly
inside this workflow without input plumbing. GH_APP_PRIVATE_KEY is
forwarded via `secrets: inherit` in each caller.

The source_input default (${{ github.event.repository.name }}) resolves
to the caller repo name, so callers typically need no `with:` block.

Unblocks: dryvist/nix-claude-code#44, dryvist/nix-ai#869

Assisted-by: Claude:claude-opus-4-8
@JacobPEvans-personal JacobPEvans-personal merged commit 15b8ba2 into main Jun 2, 2026
1 check passed
JacobPEvans-personal added a commit to dryvist/nix-claude-code that referenced this pull request Jun 2, 2026
* feat(ci): dispatch lock-update event to nix-ai on release

After a nix-claude-code release is published, notify dryvist/nix-ai via
repository_dispatch so it bumps its nix-claude-code flake input without
waiting for the next Renovate lockFileMaintenance window (~Mon/Thu).

The dispatch uses the GitHub App token scoped to nix-ai. nix-ai's own
update-flake-input receiver and dispatch-to-nix-darwin workflows complete
the two-hop propagation chain.

Assisted-by: Claude:claude-opus-4-8

* refactor(ci): slim dispatch-lock-updates to thin workflow_call caller

Replace the 41-line inline job with a 3-line call to the new reusable
workflow in dryvist/.github. All logic (matrix fan-out, App-token mint,
cross-repo dispatch) now lives in one place.

Depends on: dryvist/.github adding _dispatch-flake-consumers.yml@main
Refs: dryvist/.github#21

Assisted-by: Claude:claude-opus-4-8
JacobPEvans-personal added a commit to dryvist/nix-ai that referenced this pull request Jun 2, 2026
* feat(ci): event-driven flake input updates

Two new workflows completing the nix-claude-code → nix-ai → nix-darwin
lock-propagation chain:

update-flake-input.yml: listens for repository_dispatch from nix-claude-code
(or any dryvist upstream), calls the shared _update-flake-input reusable
workflow in dryvist/.github to bump the specified input and open an
auto-merged PR. Also available as workflow_dispatch for manual bumps.

dispatch-to-nix-darwin.yml: fires on any flake.lock push to main, notifying
dryvist/nix-darwin to bump its nix-ai input. Completes the second hop.

Assisted-by: Claude:claude-opus-4-8

* refactor(ci): slim dispatch-to-nix-darwin to thin workflow_call caller

Replace the 41-line inline job with a 3-line call to the new reusable
workflow in dryvist/.github. Also normalises the previously missing
permission-contents:write on the App token (now enforced centrally).

Depends on: dryvist/.github adding _dispatch-flake-consumers.yml@main
Refs: dryvist/.github#21

Assisted-by: Claude:claude-opus-4-8
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