Skip to content

Commit f93d093

Browse files
committed
GHA: fix caching in lint-generate-readme job
We should use the index state
1 parent 681e97f commit f93d093

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

.github/actions/generate-readme/action.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ inputs:
88
required: true
99
description: "Version of cabal"
1010
hackage-index-state:
11-
required: false
11+
required: true
1212
description: "Timestamp for Hackage index"
1313
runs:
1414
using: composite
@@ -25,10 +25,13 @@ runs:
2525
id: cache-cabal
2626
with:
2727
path: ${{ steps.setup-haskell.outputs.cabal-store }}
28-
key: generate-readme-${{ runner.os }}-ghc-${{ steps.setup-haskell.outputs.ghc-version }}-cabal-${{ steps.setup-haskell.outputs.cabal-version }}
28+
key: generate-readme-${{ runner.os }}-ghc-${{ steps.setup-haskell.outputs.ghc-version }}-cabal-${{ steps.setup-haskell.outputs.cabal-version }}-input-state-${{ inputs.hackage-index-state }}
2929

3030
- name: 🛠️ Generate README.md
31-
run: ./scripts/generate-readme.hs
31+
run: |
32+
cabal run \
33+
${{ inputs.hackage-index-state && format('--index-state={0}', inputs.hackage-index-state) }} \
34+
./scripts/generate-readme.hs
3235
shell: sh
3336

3437
- name: 💾 Save Cabal dependencies

.github/workflows/ci.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -296,9 +296,6 @@ jobs:
296296
with:
297297
ghc-version: ${{ env.DEFAULT_GHC_VERSION }}
298298
cabal-version: ${{ env.DEFAULT_CABAL_VERSION }}
299-
# The index-state is fixed to enable caching and ensure that the version
300-
# regardless of the current state of Hackage head.
301-
# If you want a newer version of cabal-fmt, use a more recent time.
302299
hackage-index-state: "2025-05-22T00:00:00Z"
303300

304301
- name: 🎗️ Lint with generate-readme

0 commit comments

Comments
 (0)