ci: make Cachix push optional to support fork PRs#5931
Merged
Conversation
Fork PRs don't receive repository secrets, so `cachix watch-exec` fails with NoSigningKey before tests start. Skip the push wrapper when CACHIX_AUTH_TOKEN is empty; read-only cache access still works via the substituter configured by `cachix use`. Made-with: Cursor
Made-with: Cursor
Contributor
Contributor
|
Very nice! |
ggreif
pushed a commit
that referenced
this pull request
Mar 26, 2026
## Problem
Fork PRs don't receive repository secrets. When `CACHIX_AUTH_TOKEN` is
empty, `cachix watch-exec` fails with a `NoSigningKey` error before
tests even start, blocking all CI for external contributors.
## Solution
Make the `cachix watch-exec` wrapper conditional in the test blueprint
action. When the auth token is absent (fork PR), run
`nix-build-uncached` directly without the push wrapper.
- The `cachix-action` step already handles an empty token gracefully —
it configures read-only substituter access via `cachix use`, so cached
derivations are still fetched.
- Only the push of newly-built derivations is lost, which is acceptable
for fork PRs.
- The token is passed via an `env` variable (not inline) to avoid
leaking it in logs.
- No caller changes needed — `${{ secrets.CACHIX_AUTH_TOKEN }}`
naturally resolves to empty for fork PRs.
Motivated by PR #5929.
Made with [Cursor](https://cursor.com)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Fork PRs don't receive repository secrets. When
CACHIX_AUTH_TOKENis empty,cachix watch-execfails with aNoSigningKeyerror before tests even start, blocking all CI for external contributors.Solution
Make the
cachix watch-execwrapper conditional in the test blueprint action. When the auth token is absent (fork PR), runnix-build-uncacheddirectly without the push wrapper.cachix-actionstep already handles an empty token gracefully — it configures read-only substituter access viacachix use, so cached derivations are still fetched.envvariable (not inline) to avoid leaking it in logs.${{ secrets.CACHIX_AUTH_TOKEN }}naturally resolves to empty for fork PRs.Motivated by PR #5929.
Made with Cursor