Skip to content

Commit c46ca0d

Browse files
committed
CI stack: don't use ! on cache-hit
`cache-hit` is a **String**, so while `!'true'` is false, `!'false'` is also false. Don't know whether I should laugh or cry.
1 parent d57e036 commit c46ca0d

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

.github/workflows/stack.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,19 +70,17 @@ jobs:
7070
restore-keys: ${{ runner.os }}-stack-${{ env.STACK_VER }}-ghc-${{ matrix.ghc-ver }}-
7171

7272
- name: Install dependencies
73-
if: ${{ !steps.cache.outputs.cache-hit }}
73+
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
7474
run: |
7575
stack build ${{ env.ARGS }} --test --only-dependencies
7676
7777
- name: Cache dependencies (save)
7878
uses: actions/cache/save@v3
79-
env:
80-
key: ${{ steps.cache.outputs.cache-primary-key }}
81-
# Will fail if we already have a cache with this key.
82-
if: ${{ !(steps.cache.outputs.cache-hit && env.key == steps.cache.outputs.cache-matched-key) }}
79+
# Will fail if we already have a cache with this key (in this case, cache-hit is true).
80+
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
8381
with:
8482
path: ${{ steps.haskell-setup.outputs.stack-root }}
85-
key: ${{ env.key }}
83+
key: ${{ steps.cache.outputs.cache-primary-key }}
8684

8785
- name: Build hackage-cli
8886
run: |

0 commit comments

Comments
 (0)