Skip to content

Commit

Permalink
workflows: add zizmor, address zizmor findings (#98)
Browse files Browse the repository at this point in the history
  • Loading branch information
woodruffw authored Nov 14, 2024
1 parent ecc4751 commit 263f07c
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 18 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/bump-rekor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ jobs:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
persist-credentials: false

- uses: actions/setup-python@v5
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5
with:
python-version-file: pyproject.toml
cache: "pip"
Expand All @@ -32,7 +34,7 @@ jobs:
./codegen/codegen.sh
- name: create PR
uses: peter-evans/create-pull-request@v7
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v7
with:
commit-message: "[BOT] Regenerate for new Rekor version"
branch: update-rekor
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
persist-credentials: false

- uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
with:
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
persist-credentials: false

- uses: actions/setup-python@v5
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5
with:
python-version-file: pyproject.toml
cache: "pip"
Expand Down
23 changes: 12 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,23 @@ on:

name: release

permissions:
# Used for trusted publishing.
# Used to sign the release's artifacts with sigstore-python.
id-token: write

# Used to attach signing artifacts to the published release.
contents: write

jobs:
pypi:
name: upload release to PyPI
runs-on: ubuntu-latest
permissions:
# Used for trusted publishing.
# Used to sign the release's artifacts with sigstore-python.
id-token: write

# Used to attach signing artifacts to the published release.
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
persist-credentials: false

- uses: actions/setup-python@v5
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5
with:
python-version-file: pyproject.toml

Expand All @@ -31,4 +32,4 @@ jobs:
run: python -m build

- name: publish
uses: pypa/[email protected]
uses: pypa/gh-action-pypi-publish@15c56dba361d8335944d31a2ecd17d700fc7bcbc # v1.12.2
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ jobs:
smoketest-dists:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
persist-credentials: false

- uses: actions/setup-python@v5
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5
with:
python-version-file: pyproject.toml

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 @@
name: GitHub Actions Security Analysis with zizmor 🌈

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

jobs:
zizmor:
name: zizmor latest via Cargo
runs-on: ubuntu-latest
permissions:
security-events: write
# required for workflows in private repositories
contents: read
actions: read
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
persist-credentials: false
- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@11df97af8e8102fd60b60a77dfbf58d40cd843b8 # v1
- name: Get zizmor
run: cargo install zizmor
- name: Run zizmor 🌈
continue-on-error: true
run: zizmor --format sarif . > results.sarif
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@396bb3e45325a47dd9ef434068033c6d5bb0d11a # v3
with:
sarif_file: results.sarif
category: zizmor

0 comments on commit 263f07c

Please sign in to comment.