From 71677398c7f1bbf15c79dec84729ea95bb1d0952 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Tue, 11 Aug 2026 22:29:42 +0200 Subject: [PATCH] pre-commit: Add zizmor --- .github/dependabot.yml | 2 ++ .github/workflows/ci.yml | 6 ++++-- .github/workflows/release.yml | 18 +++++++++--------- .pre-commit-config.yaml | 5 +++++ zizmor.yml | 3 +++ 5 files changed, 23 insertions(+), 11 deletions(-) create mode 100644 zizmor.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml index be006de9..f7e8c0eb 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -11,3 +11,5 @@ updates: - "*" # Group all Actions updates into a single larger pull request schedule: interval: weekly + cooldown: # https://nesbitt.io/2026/03/04/package-managers-need-to-cool-down.html + default-days: 7 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9e5a31dc..107fd287 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,6 +7,7 @@ on: concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true +permissions: {} jobs: build-test: runs-on: ${{ matrix.os }} @@ -19,11 +20,12 @@ jobs: os: [macos-latest, ubuntu-latest, windows-latest] steps: - name: Checkout - uses: actions/checkout@v7 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: fetch-depth: 0 + persist-credentials: false - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v7 + uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 with: python-version: ${{ matrix.python-version }} cache: 'pip' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 196969a7..c3a37493 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,11 +8,11 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v7 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - name: Set up Python - uses: actions/setup-python@v7 + uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 with: python-version: "3.x" - name: Install pypa/build @@ -24,7 +24,7 @@ jobs: - name: Build a binary wheel and a source tarball run: python3 -m build - name: Store the distribution packages - uses: actions/upload-artifact@v7 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: python-package-distributions path: dist/ @@ -44,12 +44,12 @@ jobs: steps: - name: Download all the dists - uses: actions/download-artifact@v8 + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: name: python-package-distributions path: dist/ - name: Publish distribution 📦 to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 + uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2 github-release: name: >- @@ -65,12 +65,12 @@ jobs: steps: - name: Download all the dists - uses: actions/download-artifact@v8 + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: name: python-package-distributions path: dist/ - name: Sign the dists with Sigstore - uses: sigstore/gh-action-sigstore-python@v3.5.0 + uses: sigstore/gh-action-sigstore-python@790bc6befb9d733738f18d8f895854b453640ec9 # v3.5.0 with: inputs: >- ./dist/*.tar.gz @@ -109,12 +109,12 @@ jobs: steps: - name: Download all the dists - uses: actions/download-artifact@v8 + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: name: python-package-distributions path: dist/ # TODO(cclauss): Uncomment this job step when we have admin access to test.pypi.org # - name: Publish distribution 📦 to TestPyPI - # uses: pypa/gh-action-pypi-publish@release/v1 + # uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2 # with: # repository-url: https://test.pypi.org/legacy/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b13b5860..cb33751f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -73,3 +73,8 @@ repos: rev: v0.25 hooks: - id: validate-pyproject + + - repo: https://github.com/zizmorcore/zizmor-pre-commit + rev: v1.29.0 + hooks: + - id: zizmor diff --git a/zizmor.yml b/zizmor.yml new file mode 100644 index 00000000..ee110b08 --- /dev/null +++ b/zizmor.yml @@ -0,0 +1,3 @@ +rules: + excessive-permissions: + disable: true