Skip to content

Commit 9c15c36

Browse files
authored
Merge pull request #445 from haskellfoundation/fix-github-token-permissions
Allow github actions to commit to the branch
2 parents 474e317 + a94ab43 commit 9c15c36

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

.github/workflows/main.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ on:
1818
schedule:
1919
- cron: '0 7 * * 1' # 8AM CET/11PM PT on Mondays
2020

21+
# Allow github actions to commit to the branch
22+
permissions:
23+
contents: write
2124

2225
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
2326
jobs:
@@ -34,17 +37,18 @@ jobs:
3437
# Steps represent a sequence of tasks that will be executed as part of the job
3538
steps:
3639
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
37-
- uses: actions/checkout@v3
40+
- uses: actions/checkout@v4
3841
with:
3942
fetch-depth: 0
4043

41-
- uses: haskell/actions/setup@v2
44+
- uses: haskell-actions/setup@v2
4245
name: Setup Haskell Stack
4346
with:
4447
ghc-version: ${{ matrix.ghc }}
4548
stack-version: ${{ matrix.stack }}
4649

47-
- uses: actions/cache/restore@v3
50+
- uses: actions/cache/restore@v4
51+
id: cache
4852
name: Cache ~/.stack
4953
with:
5054
path: ~/.stack
@@ -54,7 +58,10 @@ jobs:
5458
- name: Build dependencies
5559
run: stack build --system-ghc --only-dependencies
5660

57-
- uses: actions/cache/save@v3
61+
- uses: actions/cache/save@v4
62+
# We shouldn't ever run into an exact key hit (in theory),
63+
# but this prevents errors if we do.
64+
if: steps.cache.outputs.cache-hit != 'true'
5865
with:
5966
path: ~/.stack
6067
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ github.sha }}

0 commit comments

Comments
 (0)