From 2b68df100438ec24042fa3f8f62e6971098de8a0 Mon Sep 17 00:00:00 2001 From: Alex Verrico Date: Sun, 30 Aug 2026 14:01:57 +1000 Subject: [PATCH] Add zizmor & fix findings --- .github/workflows/check-pr-template.yml | 3 +++ .github/workflows/ci.yml | 3 +++ .github/workflows/new-issue.yml | 5 ++++- .github/zizmor.yml | 9 +++++++++ .pre-commit-config.yaml | 4 ++++ 5 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 .github/zizmor.yml diff --git a/.github/workflows/check-pr-template.yml b/.github/workflows/check-pr-template.yml index 9196bac..31dccfd 100644 --- a/.github/workflows/check-pr-template.yml +++ b/.github/workflows/check-pr-template.yml @@ -4,6 +4,9 @@ on: pull_request: types: [opened, edited, reopened, synchronize] +permissions: + contents: read + jobs: check-pr-template: name: Check PR template diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e91bf29..fecd771 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,6 +11,9 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true +permissions: + contents: read + defaults: run: shell: bash diff --git a/.github/workflows/new-issue.yml b/.github/workflows/new-issue.yml index e4a99c0..58e6d18 100644 --- a/.github/workflows/new-issue.yml +++ b/.github/workflows/new-issue.yml @@ -11,8 +11,11 @@ jobs: add-to-project: name: Add issue to BeeWare project runs-on: ubuntu-latest + # The add-to-project action authenticates with BRUTUS_PAT_TOKEN, so the + # job's own GITHUB_TOKEN needs no permissions. + permissions: {} steps: - - uses: actions/add-to-project@v2.0.0 + - uses: actions/add-to-project@5afcf98fcd03f1c2f92c3c83f58ae24323cc57fd # v2.0.0 with: project-url: https://github.com/orgs/beeware/projects/1 github-token: ${{ secrets.BRUTUS_PAT_TOKEN }} diff --git a/.github/zizmor.yml b/.github/zizmor.yml new file mode 100644 index 0000000..b834aff --- /dev/null +++ b/.github/zizmor.yml @@ -0,0 +1,9 @@ +rules: + unpinned-uses: + config: + # Allow BeeWare-provided actions to be unpinned. If an attacker is in a + # position to exploit those action, they're probably able to exploit + # repositories directly; and it's significantly easier for our internal + # actions to automatically be the most recent versions. + policies: + beeware/*: ref-pin diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 012ed4b..b876c10 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,3 +9,7 @@ repos: - id: check-case-conflict - id: end-of-file-fixer - id: trailing-whitespace + - repo: https://github.com/zizmorcore/zizmor-pre-commit + rev: v1.26.1 + hooks: + - id: zizmor