ci: add zizmor for GitHub Actions security analysis (#2648)
This commit is contained in:
parent
f4753440da
commit
e8e6484278
8 changed files with 63 additions and 8 deletions
3
.github/workflows/claude.yml
vendored
3
.github/workflows/claude.yml
vendored
|
|
@ -30,12 +30,13 @@ jobs:
|
||||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||||
with:
|
with:
|
||||||
fetch-depth: 1
|
fetch-depth: 1
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
- name: Run Claude Code
|
- name: Run Claude Code
|
||||||
id: claude
|
id: claude
|
||||||
uses: anthropics/claude-code-action@2f8ba26a219c06cfb0f468eef8d97055fa814f97 # v1.0.53
|
uses: anthropics/claude-code-action@2f8ba26a219c06cfb0f468eef8d97055fa814f97 # v1.0.53
|
||||||
with:
|
with:
|
||||||
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
|
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} # zizmor: ignore[secrets-outside-env]
|
||||||
use_commit_signing: true
|
use_commit_signing: true
|
||||||
additional_permissions: |
|
additional_permissions: |
|
||||||
actions: read
|
actions: read
|
||||||
|
|
|
||||||
22
.github/workflows/comment-on-release.yml
vendored
22
.github/workflows/comment-on-release.yml
vendored
|
|
@ -16,13 +16,16 @@ jobs:
|
||||||
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
|
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
- name: Get previous release
|
- name: Get previous release
|
||||||
id: previous_release
|
id: previous_release
|
||||||
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
|
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
|
||||||
|
env:
|
||||||
|
CURRENT_TAG: ${{ github.event.release.tag_name }}
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
const currentTag = '${{ github.event.release.tag_name }}';
|
const currentTag = process.env.CURRENT_TAG;
|
||||||
|
|
||||||
// Get all releases
|
// Get all releases
|
||||||
const { data: releases } = await github.rest.repos.listReleases({
|
const { data: releases } = await github.rest.repos.listReleases({
|
||||||
|
|
@ -54,10 +57,13 @@ jobs:
|
||||||
- name: Get merged PRs between releases
|
- name: Get merged PRs between releases
|
||||||
id: get_prs
|
id: get_prs
|
||||||
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
|
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
|
||||||
|
env:
|
||||||
|
CURRENT_TAG: ${{ github.event.release.tag_name }}
|
||||||
|
PREVIOUS_TAG_JSON: ${{ steps.previous_release.outputs.result }}
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
const currentTag = '${{ github.event.release.tag_name }}';
|
const currentTag = process.env.CURRENT_TAG;
|
||||||
const previousTag = ${{ steps.previous_release.outputs.result }};
|
const previousTag = JSON.parse(process.env.PREVIOUS_TAG_JSON);
|
||||||
|
|
||||||
if (!previousTag) {
|
if (!previousTag) {
|
||||||
console.log('No previous release found, skipping');
|
console.log('No previous release found, skipping');
|
||||||
|
|
@ -104,11 +110,15 @@ jobs:
|
||||||
|
|
||||||
- name: Comment on PRs
|
- name: Comment on PRs
|
||||||
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
|
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
|
||||||
|
env:
|
||||||
|
PR_NUMBERS_JSON: ${{ steps.get_prs.outputs.result }}
|
||||||
|
RELEASE_TAG: ${{ github.event.release.tag_name }}
|
||||||
|
RELEASE_URL: ${{ github.event.release.html_url }}
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
const prNumbers = ${{ steps.get_prs.outputs.result }};
|
const prNumbers = JSON.parse(process.env.PR_NUMBERS_JSON);
|
||||||
const releaseTag = '${{ github.event.release.tag_name }}';
|
const releaseTag = process.env.RELEASE_TAG;
|
||||||
const releaseUrl = '${{ github.event.release.html_url }}';
|
const releaseUrl = process.env.RELEASE_URL;
|
||||||
|
|
||||||
const comment = `This pull request is included in [${releaseTag}](${releaseUrl})`;
|
const comment = `This pull request is included in [${releaseTag}](${releaseUrl})`;
|
||||||
|
|
||||||
|
|
|
||||||
4
.github/workflows/conformance.yml
vendored
4
.github/workflows/conformance.yml
vendored
|
|
@ -19,6 +19,8 @@ jobs:
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
|
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
- uses: astral-sh/setup-uv@803947b9bd8e9f986429fa0c5a41c367cd732b41 # v7.2.1
|
- uses: astral-sh/setup-uv@803947b9bd8e9f986429fa0c5a41c367cd732b41 # v7.2.1
|
||||||
with:
|
with:
|
||||||
enable-cache: true
|
enable-cache: true
|
||||||
|
|
@ -34,6 +36,8 @@ jobs:
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
|
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
- uses: astral-sh/setup-uv@803947b9bd8e9f986429fa0c5a41c367cd732b41 # v7.2.1
|
- uses: astral-sh/setup-uv@803947b9bd8e9f986429fa0c5a41c367cd732b41 # v7.2.1
|
||||||
with:
|
with:
|
||||||
enable-cache: true
|
enable-cache: true
|
||||||
|
|
|
||||||
2
.github/workflows/deploy-docs.yml
vendored
2
.github/workflows/deploy-docs.yml
vendored
|
|
@ -34,6 +34,8 @@ jobs:
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
|
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
- name: Install uv
|
- name: Install uv
|
||||||
uses: astral-sh/setup-uv@803947b9bd8e9f986429fa0c5a41c367cd732b41 # v7.2.1
|
uses: astral-sh/setup-uv@803947b9bd8e9f986429fa0c5a41c367cd732b41 # v7.2.1
|
||||||
|
|
|
||||||
7
.github/workflows/publish-pypi.yml
vendored
7
.github/workflows/publish-pypi.yml
vendored
|
|
@ -4,6 +4,9 @@ on:
|
||||||
release:
|
release:
|
||||||
types: [published]
|
types: [published]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
release-build:
|
release-build:
|
||||||
name: Build distribution
|
name: Build distribution
|
||||||
|
|
@ -11,11 +14,13 @@ jobs:
|
||||||
needs: [checks]
|
needs: [checks]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
|
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
- name: Install uv
|
- name: Install uv
|
||||||
uses: astral-sh/setup-uv@803947b9bd8e9f986429fa0c5a41c367cd732b41 # v7.2.1
|
uses: astral-sh/setup-uv@803947b9bd8e9f986429fa0c5a41c367cd732b41 # v7.2.1
|
||||||
with:
|
with:
|
||||||
enable-cache: true
|
enable-cache: false
|
||||||
version: 0.9.5
|
version: 0.9.5
|
||||||
|
|
||||||
- name: Set up Python 3.12
|
- name: Set up Python 3.12
|
||||||
|
|
|
||||||
6
.github/workflows/shared.yml
vendored
6
.github/workflows/shared.yml
vendored
|
|
@ -14,6 +14,8 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
|
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
- uses: astral-sh/setup-uv@803947b9bd8e9f986429fa0c5a41c367cd732b41 # v7.2.1
|
- uses: astral-sh/setup-uv@803947b9bd8e9f986429fa0c5a41c367cd732b41 # v7.2.1
|
||||||
with:
|
with:
|
||||||
|
|
@ -57,6 +59,8 @@ jobs:
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
|
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
- name: Install uv
|
- name: Install uv
|
||||||
uses: astral-sh/setup-uv@803947b9bd8e9f986429fa0c5a41c367cd732b41 # v7.2.1
|
uses: astral-sh/setup-uv@803947b9bd8e9f986429fa0c5a41c367cd732b41 # v7.2.1
|
||||||
|
|
@ -83,6 +87,8 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
|
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
- uses: astral-sh/setup-uv@803947b9bd8e9f986429fa0c5a41c367cd732b41 # v7.2.1
|
- uses: astral-sh/setup-uv@803947b9bd8e9f986429fa0c5a41c367cd732b41 # v7.2.1
|
||||||
with:
|
with:
|
||||||
|
|
|
||||||
2
.github/workflows/weekly-lockfile-update.yml
vendored
2
.github/workflows/weekly-lockfile-update.yml
vendored
|
|
@ -15,6 +15,8 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
- uses: astral-sh/setup-uv@803947b9bd8e9f986429fa0c5a41c367cd732b41 # v7.2.1
|
- uses: astral-sh/setup-uv@803947b9bd8e9f986429fa0c5a41c367cd732b41 # v7.2.1
|
||||||
with:
|
with:
|
||||||
|
|
|
||||||
25
.github/workflows/zizmor.yml
vendored
Normal file
25
.github/workflows/zizmor.yml
vendored
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
name: GitHub Actions Security Analysis
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: ["main"]
|
||||||
|
pull_request:
|
||||||
|
branches: ["**"]
|
||||||
|
|
||||||
|
permissions: {}
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
zizmor:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
security-events: write # Required for upload-sarif (used by zizmor-action) to upload SARIF files.
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
|
- name: Run zizmor 🌈
|
||||||
|
uses: zizmorcore/zizmor-action@5f14fd08f7cf1cb1609c1e344975f152c7ee938d # v0.5.6
|
||||||
Loading…
Reference in a new issue