diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 9987448f..0d7dd0e8 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -6,6 +6,9 @@ on: branches: - main +permissions: + contents: read + jobs: test: runs-on: ubuntu-latest @@ -15,9 +18,11 @@ jobs: python: ["3.10", "3.12"] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + persist-credentials: false - name: Install uv - uses: astral-sh/setup-uv@v3 + uses: astral-sh/setup-uv@caf0cab7a618c569241d31dcd442f54681755d39 # v3.2.4 with: enable-cache: true - name: Set up Python ${{ matrix.python }} @@ -35,9 +40,11 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + persist-credentials: false - name: Install uv - uses: astral-sh/setup-uv@v3 + uses: astral-sh/setup-uv@caf0cab7a618c569241d31dcd442f54681755d39 # v3.2.4 with: enable-cache: true - name: Set up Python @@ -55,9 +62,11 @@ jobs: docs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + persist-credentials: false - name: Install uv - uses: astral-sh/setup-uv@v3 + uses: astral-sh/setup-uv@caf0cab7a618c569241d31dcd442f54681755d39 # v3.2.4 with: enable-cache: true - name: Set up Python @@ -69,7 +78,7 @@ jobs: run: | mkdir ./docs/build uv run ./docs/generate.sh --out=./docs/build/ --pypath=src/ - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0 name: Upload Docs Preview with: name: reference-docs @@ -78,9 +87,11 @@ jobs: format: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + persist-credentials: false - name: Install uv - uses: astral-sh/setup-uv@v3 + uses: astral-sh/setup-uv@caf0cab7a618c569241d31dcd442f54681755d39 # v3.2.4 with: enable-cache: true - name: Set up Python @@ -90,4 +101,4 @@ jobs: uv sync - name: Check Formatting with ruff run: | - uv run ruff format --check . \ No newline at end of file + uv run ruff format --check . diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index ead40bf0..68e43a3c 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -20,6 +20,9 @@ on: # Allow workflow to be triggered manually. workflow_dispatch: +permissions: + contents: read + jobs: stage_release: # To publish a release, merge the release PR with the label 'release:publish'. @@ -34,15 +37,17 @@ jobs: steps: - name: Checkout source for staging - uses: actions/checkout@v3 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + persist-credentials: false - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0 with: python-version: '3.10' - name: Install uv - uses: astral-sh/setup-uv@v3 + uses: astral-sh/setup-uv@caf0cab7a618c569241d31dcd442f54681755d39 # v3.2.4 with: enable-cache: true @@ -62,7 +67,7 @@ jobs: # Attach the packaged artifacts to the workflow output. These can be manually # downloaded for later inspection if necessary. - name: Archive artifacts - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0 with: name: dist path: dist/ @@ -92,11 +97,13 @@ jobs: steps: - name: Checkout source for publish - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + persist-credentials: false # Download the artifacts created by the stage_release job. - name: Download release candidates - uses: actions/download-artifact@v4.1.7 + uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 with: name: dist path: dist @@ -111,7 +118,7 @@ jobs: - name: Create release tag # Skip creating a release tag for prereleases if: (!contains(github.event.pull_request.labels.*.name, 'release:prerelease')) - uses: fleskesvor/create-release@1a72e235c178bf2ae6c51a8ae36febc24568c5fe + uses: fleskesvor/create-release@1a72e235c178bf2ae6c51a8ae36febc24568c5fe # zizmor: ignore[unpinned-uses] env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: @@ -122,4 +129,4 @@ jobs: prerelease: false - name: Publish to Pypi - uses: pypa/gh-action-pypi-publish@release/v1 + uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2