ci: add zizmor check action (#2306)

This makes it so that if the `.github/workflows` directory is modified, we'll run `zizmor` to check things.

This also fixes some zizmor warnings:

- https://docs.zizmor.sh/audits/#self-repository
- For now, mutes the secret inherits one; this will be fixed later.
This commit is contained in:
Clement Tsang authored and GitHub committed 2026-11-09 01:55:59 -05:00
1 parent cc6facab16
commit 9e6df79fce
6 files changed
+46 -6

No files matched your search

+1 -1
View File
@@ -324,7 +324,7 @@ jobs:
# *BSD targets run tests in a VM due to cross limitations.
- name: Run tests (BSD)
if: ${{ contains(matrix.info.checks, 'test') && contains(matrix.info.target, 'bsd') }}
uses: ./.github/actions/test-bsd-target
uses: $/.github/actions/test-bsd-target
with:
target: ${{ matrix.info.target }}
os-version: ${{ matrix.info.os-version }}
+1 -1
View File
@@ -48,7 +48,7 @@ jobs:
id-token: write
contents: read
attestations: write
uses: ./.github/workflows/build_releases.yml
uses: $/.github/workflows/build_releases.yml # zizmor: ignore[secrets-inherit]
with:
caller: "deployment"
secrets: inherit
+1 -1
View File
@@ -71,5 +71,5 @@ jobs:
permissions:
pages: write
id-token: write
uses: ./.github/workflows/publish_github_pages.yml
uses: $/.github/workflows/publish_github_pages.yml # zizmor: ignore[secrets-inherit]
secrets: inherit
+2 -2
View File
@@ -55,7 +55,7 @@ jobs:
id-token: write
contents: read
attestations: write
uses: ./.github/workflows/build_releases.yml
uses: $/.github/workflows/build_releases.yml # zizmor: ignore[secrets-inherit]
with:
caller: "nightly"
secrets: inherit
@@ -155,7 +155,7 @@ jobs:
pages: write
id-token: write
contents: write
uses: ./.github/workflows/docs.yml
uses: $/.github/workflows/docs.yml # zizmor: ignore[secrets-inherit]
secrets: inherit
with:
version: nightly
+1 -1
View File
@@ -52,7 +52,7 @@ jobs:
pages: write
id-token: write
contents: write
uses: ./.github/workflows/docs.yml
uses: $/.github/workflows/docs.yml # zizmor: ignore[secrets-inherit]
secrets: inherit
with:
version: ${{ needs.initialize.outputs.version }}
+40
View File
@@ -0,0 +1,40 @@
# Runs Zizmor to verify GitHub workflows.
name: Zizmor
on:
workflow_dispatch:
pull_request:
paths:
- ".github/workflows/**"
push:
branches:
- main
paths:
- ".github/workflows/**"
permissions: {}
jobs:
zizmor:
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Enable Rust cache for Zizmor binary
uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # 2.9.2
if: ${{ github.event_name != 'pull_request' || ! github.event.pull_request.head.repo.fork }} # If it is a PR, only if not a fork
with:
key: "zizmor"
cache-bin: true
- name: Install Zizmor
run: cargo install --locked zizmor
- name: Run Zizmor
run: zizmor ./