Skip to content

Commit

Permalink
Skip cachix jobs if token is unset (#1845)
Browse files Browse the repository at this point in the history
  • Loading branch information
berberman committed May 21, 2021
1 parent 9abf566 commit a06b2e6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/nix.yml
Expand Up @@ -20,6 +20,8 @@ jobs:
nix:
needs: pre_job
runs-on: ${{ matrix.os }}
env:
HAS_TOKEN: ${{ secrets.HLS_CACHIX_AUTH_TOKEN != '' }}

strategy:
fail-fast: false
Expand All @@ -39,14 +41,14 @@ jobs:
extra_nix_config: |
experimental-features = nix-command flakes
nix_path: nixpkgs=channel:nixos-unstable
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
- if: ${{ needs.pre_job.outputs.should_skip != 'true' && env.HAS_TOKEN == 'true' }}
uses: cachix/cachix-action@v8
with:
name: haskell-language-server
authToken: ${{ secrets.HLS_CACHIX_AUTH_TOKEN }}
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
run: nix build
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
- if: ${{ needs.pre_job.outputs.should_skip != 'true' && env.HAS_TOKEN == 'true' }}
run: nix develop --profile dev && cachix push haskell-language-server dev
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
- if: ${{ needs.pre_job.outputs.should_skip != 'true' && env.HAS_TOKEN == 'true' }}
run: nix path-info --json | jq -r '.[].path' | cachix push haskell-language-server

0 comments on commit a06b2e6

Please sign in to comment.