Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Audit GHA workflows with zizmor #7624

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/devcontainer-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ jobs:
steps:
- name: Checkout source
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
persist-credentials: false

- name: Setup Docker buildx
uses: docker/[email protected]
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
persist-credentials: false

- name: Login to Docker Hub
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/mypy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
persist-credentials: false
- uses: mamba-org/setup-micromamba@v2
with:
environment-file: conda-envs/environment-test.yml
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/pr-auto-label.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
name: "Pull Request Labeler"
on:
- pull_request_target
# The labeler doesn't execute any contributed code, so it should be fairly safe.
- pull_request_target # zizmor: ignore[dangerous-triggers]

jobs:
sync:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Sync labels with closing issues
uses: wd60622/[email protected]
with:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ jobs:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN_PYMC }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@v5
with:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/rtd-link-preview.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
name: Read the Docs Pull Request Preview
on:
pull_request_target:
# See <https://github.com/readthedocs/actions/issues/45>
pull_request_target: # zizmor: ignore[dangerous-triggers]
types:
- opened

permissions:
pull-requests: write

jobs:
documentation-links:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: readthedocs/actions/preview@v1
with:
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ jobs:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
fetch-depth: 0
persist-credentials: false
- uses: dorny/paths-filter@v3
id: changes
with:
Expand Down Expand Up @@ -143,6 +144,8 @@ jobs:
shell: bash -leo pipefail {0}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
persist-credentials: false
- uses: mamba-org/setup-micromamba@v2
with:
environment-file: conda-envs/environment-test.yml
Expand Down Expand Up @@ -193,6 +196,8 @@ jobs:
shell: cmd /C call {0}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
persist-credentials: false
- uses: mamba-org/setup-micromamba@v2
with:
environment-file: conda-envs/windows-environment-test.yml
Expand Down Expand Up @@ -251,6 +256,8 @@ jobs:
shell: bash -leo pipefail {0}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
persist-credentials: false
- uses: mamba-org/setup-micromamba@v2
with:
environment-file: conda-envs/environment-test.yml
Expand Down Expand Up @@ -295,6 +302,8 @@ jobs:
shell: bash -leo pipefail {0}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
persist-credentials: false
- uses: mamba-org/setup-micromamba@v2
with:
environment-file: conda-envs/environment-jax.yml
Expand Down Expand Up @@ -339,6 +348,8 @@ jobs:
shell: cmd /C call {0}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
persist-credentials: false
- uses: mamba-org/setup-micromamba@v2
with:
environment-file: conda-envs/windows-environment-test.yml
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/zizmor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# https://github.com/woodruffw/zizmor
name: zizmor GHA analysis

on:
push:
branches: ["main"]
pull_request:
branches: ["**"]

jobs:
zizmor:
name: zizmor latest via PyPI
runs-on: ubuntu-latest
permissions:
security-events: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
persist-credentials: false

- uses: hynek/setup-cached-uv@v2

- name: Run zizmor 🌈
run: uvx zizmor --format sarif . > results.sarif
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v3
with:
# Path to SARIF file relative to the root of the repository
sarif_file: results.sarif
# Optional category for the results
# Used to differentiate multiple results for one commit
category: zizmor
Loading