Skip to content

Commit 13e86c0

Browse files
authored
[CI] Add zizmor with pre-commit (NextCommunity#361)
1 parent 31da4e2 commit 13e86c0

4 files changed

Lines changed: 15 additions & 5 deletions

File tree

.github/linters/zizmor.yml

Whitespace-only changes.

.github/workflows/deploy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ jobs:
2626
npm install
2727
npm run build
2828
- name: Upload artifact
29-
uses: actions/upload-pages-artifact@v4
29+
uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4.0.0
3030
with:
3131
path: "_site" # The directory that contains the deployable files
3232
- name: Deploy to GitHub Pages
3333
id: deployment
34-
uses: actions/deploy-pages@v4
34+
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5

.github/workflows/pre-commit.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
fetch-depth: 0
1717
persist-credentials: false
1818
- name: Set up Python
19-
uses: actions/setup-python@v6
19+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
2020
with:
2121
python-version: "3.x"
2222
architecture: "x64"
@@ -25,9 +25,9 @@ jobs:
2525
python -m pip install --upgrade pip
2626
pip install pre-commit
2727
- name: Set PY
28-
run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
28+
run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> "$GITHUB_ENV"
2929
- name: Cache Pre-commit Hooks
30-
uses: actions/cache@v5
30+
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
3131
with:
3232
path: ~/.cache/pre-commit
3333
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}

.pre-commit-config.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,3 +148,13 @@ repos:
148148
args: [--strict, -c=.github/linters/.yaml-lint.yml]
149149
types: [yaml]
150150
files: \.ya?ml$
151+
152+
- repo: https://github.com/zizmorcore/zizmor-pre-commit
153+
rev: v1.23.1
154+
hooks:
155+
- id: zizmor
156+
name: run zizmor
157+
description: zizmor is a static analysis tool for GitHub Actions
158+
# args: [--config=.github/linters/zizmor.yml]
159+
files: ^\.github/workflows/.*$
160+
types: [yaml]

0 commit comments

Comments
 (0)