Skip to content

Commit ca39444

Browse files
authored
Merge pull request #756 from IntersectMBO/jdral/generate-readme-caching
GHA: fix caching in `lint-generate-readme` job
2 parents 44f7285 + f93d093 commit ca39444

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
@@ -310,9 +310,6 @@ jobs:
310310
with:
311311
ghc-version: ${{ env.DEFAULT_GHC_VERSION }}
312312
cabal-version: ${{ env.DEFAULT_CABAL_VERSION }}
313-
# The index-state is fixed to enable caching and ensure that the version
314-
# regardless of the current state of Hackage head.
315-
# If you want a newer version of cabal-fmt, use a more recent time.
316313
hackage-index-state: "2025-05-22T00:00:00Z"
317314

318315
- name: 🎗️ Lint with generate-readme

0 commit comments

Comments
 (0)