Skip to content

ci(nix): trigger vendorHash workflow via workflow_run#192

Merged
mmanciop merged 1 commit into
mainfrom
ci/nix-vendor-hash-workflow-run
Jul 16, 2026
Merged

ci(nix): trigger vendorHash workflow via workflow_run#192
mmanciop merged 1 commit into
mainfrom
ci/nix-vendor-hash-workflow-run

Conversation

@mmanciop

@mmanciop mmanciop commented Jul 16, 2026

Copy link
Copy Markdown
Member

Summary

Switch the Nix vendorHash workflow from push to workflow_run, chained off the Nix build workflow.

Why

Run 29481599947 on PR #188 failed with the same Input required and not supplied: token error we thought PR #191 fixed. The GitHub docs make it explicit: any event triggered directly by Dependabot — pull_request, pull_request_target, push, etc. — gets a read-only GITHUB_TOKEN and no access to Actions secrets. push did not escape that.

workflow_run does. It fires after another workflow completes, and the follow-up run starts from the base repo on the default branch. It's not classified as Dependabot-triggered, so Actions secrets (including REPOSITORY_FULL_ACCESS_GITHUB_TOKEN) resolve.

How it works

  1. Dependabot opens (or updates) a PR that changes go.mod/go.sum.
  2. Nix build workflow (nix.yml) runs on the PR, fails because vendorHash is stale.
  3. workflow_run fires this workflow; job guard confirms failure + non-main + same-repo.
  4. Workflow checks out the PR head branch, runs nix/update-vendor-hash.sh, pushes the fix as a follow-up commit.
  5. The fix commit re-triggers Nix, which either goes green (hash was fixed) or triggers this workflow again (converges on a no-op).

The `push` trigger from PR #191 doesn't escape Dependabot's secret
restrictions — GitHub applies the read-only / no-secrets policy to any
event triggered directly by Dependabot, including `push`. That's why
run 29481599947 on PR #188 failed with the same "Input required and not
supplied: token" as before the workflow rewrite.

Switch to `workflow_run` off the `Nix` build workflow. `workflow_run`
runs start from the base repo on the default branch and are not
classified as Dependabot-triggered, so Actions secrets (including the
push-back PAT) resolve.

The workflow now fires only when the `Nix` build failed on a non-main
same-repo branch. `workflow_dispatch` remains for manual re-runs and
takes an explicit `branch` input.
@mmanciop
mmanciop force-pushed the ci/nix-vendor-hash-workflow-run branch from 81e8261 to fe9882c Compare July 16, 2026 08:22
@mmanciop
mmanciop merged commit 9cd7478 into main Jul 16, 2026
67 checks passed
@mmanciop
mmanciop deleted the ci/nix-vendor-hash-workflow-run branch July 16, 2026 08:29
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 16, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant