GHA: Adds hashFiles() to cache key #298
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Check | |
# yamllint disable-line rule:truthy | |
on: | |
pull_request: | |
push: | |
jobs: | |
Pre-commit: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/cache@v4 | |
with: | |
path: ~/.cache/pre-commit | |
key: pre-commit|${{ hashFiles('.pre-commit-config.yaml') }} | |
- name: Installs shfmt | |
run: > | |
sudo install /dev/stdin /usr/local/bin/shfmt | |
< <(curl -L "$SHFMT_URL") | |
env: | |
# yamllint disable-line rule:line-length | |
SHFMT_URL: https://github.com/mvdan/sh/releases/download/v3.1.1/shfmt_v3.1.1_linux_amd64 | |
- uses: actions/setup-python@v3 | |
- uses: pre-commit/action@v3.0.0 |