From 7c1366cf3e645d72bdfdef521ed7a1224db353a4 Mon Sep 17 00:00:00 2001 From: Naji Obeid Date: Fri, 3 Jan 2025 18:33:58 +0000 Subject: [PATCH 1/2] integrate zizmor in github actions --- .github/workflows/test.yml | 2 ++ .github/workflows/zizmor.yml | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 .github/workflows/zizmor.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6ce08b1..83c47ca 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -30,6 +30,8 @@ jobs: name: "Build ${{ matrix.perl-version }} test on ${{ matrix.platform }}" steps: - uses: actions/checkout@v2 + with: + persist-credentials: false - uses: shogo82148/actions-setup-perl@v1 with: perl-version: ${{ matrix.perl-version }} diff --git a/.github/workflows/zizmor.yml b/.github/workflows/zizmor.yml new file mode 100644 index 0000000..d915605 --- /dev/null +++ b/.github/workflows/zizmor.yml @@ -0,0 +1,36 @@ +name: GitHub Actions Security Analysis with zizmor + +on: + push: + branches: ["main"] + pull_request: + branches: ["**"] + +jobs: + zizmor: + name: zizmor latest via PyPI + 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@v4 + with: + persist-credentials: false + + - name: Install the latest version of uv + uses: astral-sh/setup-uv@v5 + + - 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: + sarif_file: results.sarif + category: zizmor From e098ef6de6e7f483e1f354cd2154a5be51b50fd9 Mon Sep 17 00:00:00 2001 From: Naji Obeid Date: Wed, 8 Jan 2025 15:30:19 +0000 Subject: [PATCH 2/2] change zizmor output format to report warnings --- .github/workflows/zizmor.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/zizmor.yml b/.github/workflows/zizmor.yml index d915605..c09cf12 100644 --- a/.github/workflows/zizmor.yml +++ b/.github/workflows/zizmor.yml @@ -23,14 +23,10 @@ jobs: - name: Install the latest version of uv uses: astral-sh/setup-uv@v5 + with: + enable-cache: false - name: Run zizmor - run: uvx zizmor --format sarif . > results.sarif + run: uvx zizmor --format plain . env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Upload SARIF file - uses: github/codeql-action/upload-sarif@v3 - with: - sarif_file: results.sarif - category: zizmor