From 6bfd19f7882ec814692e2f7821d85651e46ce883 Mon Sep 17 00:00:00 2001 From: Venkata Sai Madhur Karampudi Date: Thu, 13 Aug 2026 18:36:32 +0000 Subject: [PATCH 1/2] ci: fix zizmor security findings in GitHub Actions workflows - Pin GitHub Action references to immutable commit SHAs - Add explicit 'permissions: contents: read' blocks - Set 'persist-credentials: false' on checkout steps --- .github/workflows/ci-lint.yml | 10 +++++++--- .github/workflows/test.yml | 9 +++++++-- .github/workflows/wheels.yml | 19 ++++++++++++------- 3 files changed, 26 insertions(+), 12 deletions(-) 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..766d462 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@76f52bc884231f62b9a034ebfe128415bbaabdfc # release/v1.12 with: password: ${{ secrets.PYPI_API_TOKEN }} packages-dir: wheels/ From 0d70e82e6967282329dedd030eecb88c985f9d80 Mon Sep 17 00:00:00 2001 From: Venkata Sai Madhur Karampudi Date: Thu, 13 Aug 2026 19:18:57 +0000 Subject: [PATCH 2/2] ci: update pypa/gh-action-pypi-publish to latest release v1.14.2 to fix GHSA-vxmw-7h4f-hqxh --- .github/workflows/wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 766d462..75542bb 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -93,7 +93,7 @@ jobs: - name: Upload to PyPI # zizmor: ignore[use-trusted-publishing] - uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # release/v1.12 + uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # release/v1 with: password: ${{ secrets.PYPI_API_TOKEN }} packages-dir: wheels/