diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 4a469834..1c1f9030 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -1,6 +1,6 @@ name: "Pull Request Labeler" on: - pull_request_target: + pull_request: types: [opened, reopened] jobs: @@ -11,6 +11,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + with: + persist-credentials: false - uses: actions/labeler@v5 with: repo-token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml index 83976ef1..3899320f 100644 --- a/.github/workflows/publish-to-pypi.yml +++ b/.github/workflows/publish-to-pypi.yml @@ -1,20 +1,18 @@ name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI on: - workflow_dispatch: - pull_request: push: tags: - "*" - branches: - - main - - "release/*" -permissions: - id-token: write jobs: build-n-publish: runs-on: ubuntu-latest + environment: pypi + permissions: + id-token: write steps: - uses: actions/checkout@v4 + with: + persist-credentials: false - name: Set up Python uses: actions/setup-python@v5 with: @@ -36,7 +34,4 @@ jobs: --wheel --outdir dist/ - name: Publish distribution to PyPI - if: startsWith(github.ref, 'refs/tags') uses: pypa/gh-action-pypi-publish@release/v1 - with: - password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/.github/workflows/testing-and-deployment.yml b/.github/workflows/testing-and-deployment.yml index 77084f29..1ac7baad 100644 --- a/.github/workflows/testing-and-deployment.yml +++ b/.github/workflows/testing-and-deployment.yml @@ -31,6 +31,7 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 2 + persist-credentials: false - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4ea5ecf3..e4abbe9d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -96,3 +96,8 @@ repos: args: [--branch, main] - id: requirements-txt-fixer - id: trailing-whitespace + + - repo: https://github.com/woodruffw/zizmor-pre-commit + rev: v0.8.0 + hooks: + - id: zizmor