- Install shfmt and cache it for GitHub Actions
- Caching makes it especially efficient when using self-hosted runners
jobs:
shfmt:
runs-on: ubuntu-latest
steps:
- uses: pollenjp/setup-shfmt@v1
with:
version: latest
# version: 3.10.0
- uses: actions/checkout@v4
- name: Run shfmt
run: shfmt -d .
If you use GitHub Enterprise Server, set the specific version (X.Y.Z
), or set
github-token
empty and version: latest
.
jobs:
shellcheck:
runs-on: ubuntu-latest
steps:
- uses: pollenjp/setup-shfmt@v1
with:
version: 3.10.0
#
#or
#
# version: latest # 'latest' requests GitHub API (github.com)
# github-token: '' # Empty token may result in reaching the rate limit
# # for anonymous requests
- uses: actions/checkout@v4
- name: Run shfmt
run: shfmt -d .
- mfinelli/setup-shfmt
- This actions is
not caching,
and is installing shfmt to
$HOME/bin
which is not desirable for self-hosted runners.
- This actions is
not caching,
and is installing shfmt to