Skip to content

Commit d7d1fb7

Browse files
committed
ci: avoid PR GitHub token for static Nix builds
The pull_request Linux arm static build repeatedly failed while fetching the public crane flake input through Nix with an HTTP 401 Bad credentials response. The same build path passed on the push workflow, so the failure is tied to the pull_request token that setup-nix configures for GitHub fetches. For pull_request static Linux builds, clear Nix access-tokens for the build command so public GitHub flake inputs are fetched without the invalid token. Push builds keep the existing authenticated configuration.
1 parent 669513a commit d7d1fb7

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎.github/workflows/ci.yaml‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,12 @@ jobs:
101101
cargo-${{ runner.os }}-${{ runner.arch }}-
102102
- name: Build Linux static binary
103103
if: matrix.platform == 'linux'
104-
run: nix build .#ccusage-static
104+
run: |
105+
if [ "${{ github.event_name }}" = "pull_request" ]; then
106+
NIX_CONFIG="access-tokens =" nix build .#ccusage-static
107+
else
108+
nix build .#ccusage-static
109+
fi
105110
- name: Verify Linux binary is static
106111
if: matrix.platform == 'linux'
107112
shell: bash

0 commit comments

Comments
 (0)