Skip to content

Commit

Permalink
PYTHON-4967 Adopt zizmor GitHub Actions security scanner (#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
blink1073 authored Nov 13, 2024
1 parent c6c248c commit 10e04c6
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/build.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@v2
with:
persist-credentials: false
- uses: actions/setup-python@v3
- uses: pre-commit/[email protected]
with:
Expand All @@ -26,6 +28,8 @@ jobs:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false
- uses: actions/setup-python@v3
- shell: pwsh
run: |
Expand All @@ -45,6 +49,8 @@ jobs:
shell: msys2 {0}
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false
- uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.msystem }}
Expand All @@ -66,6 +72,8 @@ jobs:
fail-fast: false
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
- name: Setup Python
uses: actions/setup-python@v4
with:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ jobs:
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
persist-credentials: false
- uses: actions/setup-python@v3

# Initializes the CodeQL tools for scanning.
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
persist-credentials: false
- name: Build wheels
uses: pypa/[email protected]
env:
Expand Down Expand Up @@ -56,6 +57,7 @@ jobs:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
persist-credentials: false

- uses: actions/setup-python@v5
with:
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/zizmor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: GitHub Actions Security Analysis with zizmor

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

jobs:
zizmor:
name: zizmor latest via Cargo
runs-on: ubuntu-latest
permissions:
security-events: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Get zizmor
run: cargo install zizmor
- name: Run zizmor
run: zizmor --format sarif . > results.sarif
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: results.sarif
category: zizmor

0 comments on commit 10e04c6

Please sign in to comment.