Skip to content

Commit a06b2e6

Browse files
authored
Skip cachix jobs if token is unset (haskell#1845)
1 parent 9abf566 commit a06b2e6

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

.github/workflows/nix.yml

+5-3
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ jobs:
2020
nix:
2121
needs: pre_job
2222
runs-on: ${{ matrix.os }}
23+
env:
24+
HAS_TOKEN: ${{ secrets.HLS_CACHIX_AUTH_TOKEN != '' }}
2325

2426
strategy:
2527
fail-fast: false
@@ -39,14 +41,14 @@ jobs:
3941
extra_nix_config: |
4042
experimental-features = nix-command flakes
4143
nix_path: nixpkgs=channel:nixos-unstable
42-
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
44+
- if: ${{ needs.pre_job.outputs.should_skip != 'true' && env.HAS_TOKEN == 'true' }}
4345
uses: cachix/cachix-action@v8
4446
with:
4547
name: haskell-language-server
4648
authToken: ${{ secrets.HLS_CACHIX_AUTH_TOKEN }}
4749
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
4850
run: nix build
49-
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
51+
- if: ${{ needs.pre_job.outputs.should_skip != 'true' && env.HAS_TOKEN == 'true' }}
5052
run: nix develop --profile dev && cachix push haskell-language-server dev
51-
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
53+
- if: ${{ needs.pre_job.outputs.should_skip != 'true' && env.HAS_TOKEN == 'true' }}
5254
run: nix path-info --json | jq -r '.[].path' | cachix push haskell-language-server

0 commit comments

Comments
 (0)