Skip to content

Commit dc46a98

Browse files
authored
Update prek workflow (#280)
Use j178/prek-action to install and run prek, and add Go bin directory to PATH so shfmt is discoverable by prek hooks.
1 parent f70b128 commit dc46a98

1 file changed

Lines changed: 10 additions & 13 deletions

File tree

.github/workflows/prek.yaml

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,22 @@ concurrency:
1313
jobs:
1414
prek:
1515
name: Run prek hooks
16-
runs-on: arc-runner-15cpu
16+
runs-on: ubuntu-latest
1717

1818
steps:
1919
- uses: actions/checkout@v4
2020

21-
- name: Cache Go modules
22-
uses: actions/cache@v4
21+
- name: Set up Go
22+
uses: actions/setup-go@v5
2323
with:
24-
path: ~/.cache/go-build
25-
key: ${{ runner.os }}-go-prek-${{ hashFiles('**/go.sum') }}
24+
go-version: 1.25
25+
cache: true
2626

2727
- name: Install shfmt
28-
run: go install mvdan.cc/sh/v3/cmd/shfmt@latest
28+
run: |
29+
go install mvdan.cc/sh/v3/cmd/shfmt@latest
30+
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
2931
30-
- name: Cache prek
31-
uses: actions/cache@v4
32+
- uses: j178/prek-action@v1
3233
with:
33-
path: ~/.cache/prek
34-
key: prek-${{ hashFiles('prek.toml') }}
35-
36-
- name: Run prek
37-
run: prek run --all-files --show-diff-on-failure --verbose
34+
extra-args: '--all-files --verbose'

0 commit comments

Comments
 (0)