From 04c1f626b236e701744a790d4975763f6b443ce7 Mon Sep 17 00:00:00 2001 From: Ameer Ghani Date: Tue, 2 Jun 2026 20:56:11 +0000 Subject: [PATCH] ci: use zizmor and remediate findings --- .github/workflows/test.yaml | 12 ++++++++---- .github/workflows/zizmor.yml | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/zizmor.yml diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index c97f891fb..d98185019 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -8,24 +8,28 @@ on: branches: - main +permissions: {} + jobs: test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + with: + persist-credentials: false - name: Setup NodeJS - uses: actions/setup-node@v4 + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: node-version: 22 - name: Setup Hugo - uses: peaceiris/actions-hugo@v3 + uses: peaceiris/actions-hugo@2752ce1d29631191ea3f27c23495fa06139a5b78 # v3.2.1 with: # same as netlify.toml hugo-version: '0.148.2' extended: true - name: Set up Python 3.13 - uses: actions/setup-python@v5 + uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 with: python-version: 3.13 - name: Setup html5validator diff --git a/.github/workflows/zizmor.yml b/.github/workflows/zizmor.yml new file mode 100644 index 000000000..2d981a0dc --- /dev/null +++ b/.github/workflows/zizmor.yml @@ -0,0 +1,36 @@ +name: Lint GitHub Actions + +on: + push: + branches: + - main + - release-branch-* + pull_request: + branches: + - '**' + workflow_dispatch: + +permissions: {} + +jobs: + zizmor: + runs-on: ubuntu-24.04 + + env: + ZIZMOR_IMAGE: ghcr.io/zizmorcore/zizmor:1.25.2@sha256:14ea7f5cc7c67933394a35b5a38a277397818d232602635edb2010b313afb110 + + steps: + - name: Checkout repository + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + + - name: Run zizmor + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + docker run \ + --volume "${GITHUB_WORKSPACE}:/src:ro" \ + --workdir "/src" \ + --env "GH_TOKEN" \ + "$ZIZMOR_IMAGE" -- /src