diff --git a/.github/workflows/ci-lint.yml b/.github/workflows/ci-lint.yml index dede434..2632651 100644 --- a/.github/workflows/ci-lint.yml +++ b/.github/workflows/ci-lint.yml @@ -5,17 +5,21 @@ on: push: branches: [master] +permissions: + contents: read + jobs: pre-commit: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4.1.7 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: # Ensure the full history is fetched # This is required to run pre-commit on a specific set of commits # TODO: Remove this when all the pre-commit issues are fixed fetch-depth: 0 - - uses: actions/setup-python@v5.1.1 + persist-credentials: false + - uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0 with: python-version: 3.13 - - uses: pre-commit/action@v3.0.1 + - uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d423e14..3576323 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,6 +8,9 @@ on: - 'docs/**' workflow_dispatch: +permissions: + contents: read + env: USE_BAZEL_VERSION: "7.7.0" @@ -20,10 +23,12 @@ jobs: python-version: ['3.10', '3.11', '3.12', '3.13'] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + persist-credentials: false - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 + uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0 with: python-version: ${{ matrix.python-version }} cache: 'pip' diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index bfb7fdd..75542bb 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -6,10 +6,12 @@ on: release: types: [published] +permissions: + contents: read + env: USE_BAZEL_VERSION: "7.7.0" - jobs: build: name: > @@ -21,14 +23,15 @@ jobs: os: [ubuntu, macos] python-version: ['3.10', '3.11', '3.12', '3.13'] - runs-on: ${{ format('{0}-latest', matrix.os) }} steps: - name: Check out the repo - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + persist-credentials: false - name: Set up python - uses: actions/setup-python@v5 + uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0 with: python-version: ${{ matrix.python-version }} @@ -61,7 +64,7 @@ jobs: twine check wheelhouse/* - name: Upload wheels - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0 with: name: build-${{ matrix.python-version }}-${{ matrix.os }} path: ./wheelhouse/* @@ -75,10 +78,11 @@ jobs: name: pypi url: https://pypi.org/p/tensorflow-metadata permissions: + contents: read id-token: write steps: - name: Retrieve wheels and sdist - uses: actions/download-artifact@v4 + uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 with: merge-multiple: true path: wheels/ @@ -88,7 +92,8 @@ jobs: ls -lAs wheels/ - name: Upload to PyPI - uses: pypa/gh-action-pypi-publish@release/v1.12 + # zizmor: ignore[use-trusted-publishing] + uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # release/v1 with: password: ${{ secrets.PYPI_API_TOKEN }} packages-dir: wheels/