Skip to content

Commit ee81e2f

Browse files
committed
Build/Test Tools: Add more workflow file linting with Zizmor.
This change introduces Zizmor, which is a tool for linting GitHub Actions workflow files for security weaknesses. This compliments the existing Actionlint scanning. For more information about Actionlint and Zizmor, see the GitHub Actions Workflow Standards page in the developer handbook: https://developer.wordpress.org/coding-standards/wordpress-coding-standards/github-actions/ Some issues in workflow files that are reported by Zizmor will be addressed in follow-up commits. Props johnbillion, desrosj. See #64227 git-svn-id: https://develop.svn.wordpress.org/trunk@62250 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 4440667 commit ee81e2f

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

.github/workflows/reusable-workflow-lint.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,42 @@ jobs:
3232
uses: docker://rhysd/actionlint@sha256:887a259a5a534f3c4f36cb02dca341673c6089431057242cdc931e9f133147e9 # v1.7.7
3333
with:
3434
args: "-color -verbose"
35+
36+
# Runs the Zizmor GitHub Action workflow file linter.
37+
#
38+
# See https://github.com/zizmorcore/zizmor
39+
#
40+
# This helps guard against supply chain attacks, unpinned dependencies, excessive permissions,
41+
# dangerous triggers, credential leaks, and sophisticated security vulnerabilities.
42+
#
43+
# Performs the following steps:
44+
# - Checks out the repository.
45+
# - Installs and configures uv.
46+
# - Runs a zizmor scan.
47+
# - Uploads the SARIF file to GitHub.
48+
zizmor:
49+
name: Zizmor
50+
runs-on: ubuntu-24.04
51+
permissions:
52+
security-events: write
53+
actions: read
54+
contents: read
55+
steps:
56+
- name: Checkout repository
57+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
58+
with:
59+
persist-credentials: false
60+
61+
- name: Install the latest version of uv
62+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
63+
64+
- name: Run zizmor
65+
run: uvx zizmor@1.24.1 --persona=regular --format=sarif --strict-collection . > results.sarif
66+
env:
67+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
68+
69+
- name: Upload SARIF file
70+
uses: github/codeql-action/upload-sarif@b1bff81932f5cdfc8695c7752dcee935dcd061c8 # v4.33.0
71+
with:
72+
sarif_file: results.sarif
73+
category: zizmor

0 commit comments

Comments
 (0)