Skip to content

ci: make Cachix push optional to support fork PRs#5931

Merged
Kamirus merged 4 commits intomasterfrom
ci/optional-cachix-push
Mar 23, 2026
Merged

ci: make Cachix push optional to support fork PRs#5931
Kamirus merged 4 commits intomasterfrom
ci/optional-cachix-push

Conversation

@Kamirus
Copy link
Copy Markdown
Contributor

@Kamirus Kamirus commented Mar 23, 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

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
@Kamirus Kamirus requested a review from a team as a code owner March 23, 2026 10:15
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 23, 2026

Comparing from f1bebb1 to c4b3bde:
The produced WebAssembly code seems to be completely unchanged.
In terms of gas, no changes are observed in 5 tests.
In terms of size, no changes are observed in 5 tests.

Copy link
Copy Markdown
Contributor

@ggreif ggreif left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yay!

@Kamirus Kamirus added this pull request to the merge queue Mar 23, 2026
Merged via the queue into master with commit b9c1832 Mar 23, 2026
20 checks passed
@Kamirus Kamirus deleted the ci/optional-cachix-push branch March 23, 2026 12:39
@crusso
Copy link
Copy Markdown
Contributor

crusso commented Mar 24, 2026

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)
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.

3 participants