From e428f56441b216737a2102981c6c94f902f5ff39 Mon Sep 17 00:00:00 2001 From: Douglas Eichelberger Date: Mon, 31 Aug 2026 14:28:32 -0700 Subject: [PATCH] Add zizmor security scanning for GitHub Actions workflows Runs zizmorcore/zizmor-action on push/PR with GitHub Advanced Security (SARIF upload to the Security tab). Also resolves the two pre-existing findings zizmor surfaced in this repo: missing Dependabot cooldown config, and a template-injection-prone expression interpolated directly into a run: shell block in ci.yml (now passed via env:). --- .github/dependabot.yml | 2 ++ .github/workflows/ci.yml | 4 +++- .github/workflows/zizmor.yml | 25 +++++++++++++++++++++++++ 3 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/zizmor.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 2390d8c..274c097 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -8,3 +8,5 @@ updates: github-actions: patterns: - "*" + cooldown: + default-days: 7 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b7dd2ab..9b36820 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -60,8 +60,10 @@ jobs: - name: Assert the action failed if: steps.rubyfmt.outcome != 'failure' + env: + ACTUAL_OUTCOME: ${{ steps.rubyfmt.outcome }} run: | - echo "::error::Expected rubyfmt-action to fail on an unformatted fixture, but it reported '${{ steps.rubyfmt.outcome }}'" + echo "::error::Expected rubyfmt-action to fail on an unformatted fixture, but it reported '${ACTUAL_OUTCOME}'" exit 1 test-macos: diff --git a/.github/workflows/zizmor.yml b/.github/workflows/zizmor.yml new file mode 100644 index 0000000..c42ea47 --- /dev/null +++ b/.github/workflows/zizmor.yml @@ -0,0 +1,25 @@ +name: GitHub Actions Security Analysis with zizmor 🌈 + +on: + push: + branches: ["main"] + pull_request: + branches: ["**"] + +permissions: {} + +jobs: + zizmor: + runs-on: ubuntu-latest + permissions: + security-events: write + contents: read + actions: read + steps: + - name: Checkout repository + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + + - name: Run zizmor 🌈 + uses: zizmorcore/zizmor-action@70fb788f84895a7701f5643d103d587e460b5c99 # v0.6.3