diff --git a/.github/workflows/mypy.yaml b/.github/workflows/mypy.yaml index 8031153..09cadcc 100644 --- a/.github/workflows/mypy.yaml +++ b/.github/workflows/mypy.yaml @@ -9,9 +9,14 @@ on: jobs: mypy: runs-on: ubuntu-latest + permissions: + contents: read + steps: - name: Checkout code uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + with: + persist-credentials: false - name: Set up Python uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 diff --git a/.github/workflows/pre-commit.yaml b/.github/workflows/pre-commit.yaml index 9cf5b57..6b85612 100644 --- a/.github/workflows/pre-commit.yaml +++ b/.github/workflows/pre-commit.yaml @@ -9,9 +9,14 @@ on: jobs: pre-commit: runs-on: ubuntu-latest + permissions: + contents: read + steps: - name: Checkout code uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + with: + persist-credentials: false - name: Set up Python uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 diff --git a/.github/workflows/release-please.yaml b/.github/workflows/release-please.yaml index e98f99d..8f9e41d 100644 --- a/.github/workflows/release-please.yaml +++ b/.github/workflows/release-please.yaml @@ -5,15 +5,15 @@ on: branches: - main -permissions: - contents: write - pull-requests: write - jobs: release-please: runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write outputs: release_created: ${{ steps.release.outputs.release_created }} + steps: - name: Run release-please id: release @@ -26,9 +26,14 @@ jobs: if: ${{ needs.release-please.outputs.release_created }} needs: release-please runs-on: ubuntu-latest + permissions: + contents: read + steps: - name: Checkout code uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + with: + persist-credentials: false - name: Set up Python uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 @@ -59,6 +64,7 @@ jobs: url: https://test.pypi.org/p/geometer permissions: id-token: write + steps: - name: Download all the dists uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 @@ -80,6 +86,7 @@ jobs: url: https://pypi.org/p/geometer permissions: id-token: write + steps: - name: Download all the dists uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 diff --git a/.github/workflows/semantic-pr.yaml b/.github/workflows/semantic-pr.yaml index 085c8fe..848321d 100644 --- a/.github/workflows/semantic-pr.yaml +++ b/.github/workflows/semantic-pr.yaml @@ -1,18 +1,23 @@ name: Semantic PR Check on: + # pull_request_target is safe here because: + # 1. No PR code is checked out + # 2. Only validates PR title (no code execution from PR) + # 3. Minimal permissions (pull-requests: read) + # zizmor: ignore[dangerous-triggers] pull_request_target: types: - opened - edited - synchronize -permissions: - pull-requests: read - jobs: validate-pr-title: name: Validate PR title runs-on: ubuntu-latest + permissions: + pull-requests: read + steps: - uses: amannn/action-semantic-pull-request@48f256284bd46cdaab1048c3721360e808335d50 # v6.1.1 env: diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index dea1dc0..4d48fc1 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -9,12 +9,17 @@ on: jobs: test: runs-on: ubuntu-latest + permissions: + contents: read strategy: matrix: python-version: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14'] + steps: - name: Checkout code uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + with: + persist-credentials: false - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 505c040..47eded4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,7 +12,7 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.14.10 hooks: - - id: ruff + - id: ruff-check args: [--fix, --exit-non-zero-on-fix] - id: ruff-format - repo: https://github.com/codespell-project/codespell @@ -45,3 +45,7 @@ repos: - id: markdownlint-cli2 args: [--fix] exclude: CHANGELOG\.md + - repo: https://github.com/zizmorcore/zizmor-pre-commit + rev: v1.19.0 + hooks: + - id: zizmor