ci: Resolve GitHub Actions security and fix Zizmor audit findings - #284
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of Changes
This PR addresses all security findings and warnings reported by the centralized Zizmor security scanner (
google-gh-automation/ Zizmor) across the repository's GitHub Actions workflows and build configurations.Key Improvements
Least-Privilege Permissions (
excessive-permissions&artipacked):permissions: contents: readto all workflows (ci-lint.yml,conda-build.yml,docs.yml).persist-credentials: falseacross allactions/checkoutsteps to avoid persisting GitHub tokens into build runners.id-token: writestrictly to theupload_to_pypijob inconda-build.yml.docs.ymlto pure read-only doc syntax validation (mkdocs build), eliminating unnecessarycontents: writetokens on PRs.Template Injection Remediation (
template-injection):.github/reusable-build/action.yml, replaced inline${{ matrix.python-version }}interpolation with a safely scoped environment variablePYTHON_VERSION.Full Action SHA Pinning (
unpinned-uses&known-vulnerable-actions):actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683(# v4.2.2)actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38(# v5.4.0)mamba-org/setup-micromamba@4b9113af4fba0e9e1124b252dd6497a419e7396d(# v1.11.0)actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1(# v4.6.1)actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16(# v4.1.8)pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd(# v3.0.1)pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33(# release/v1) with# zizmor: ignore[use-trusted-publishing]macOS ARM64 Apple Silicon Toolchain Fix:
--repo_env=BAZEL_USE_CPP_ONLY_TOOLCHAIN=1to.bazelrcandsetup.pyon Darwin to route compilation directly through system Clang, preventing Bazel'swrapped_clangdyld crashes on macOS 14/15 runners.Verification
zizmor(v1.25.2 & v1.29.0): 0 findings (Clean pass, exit code 0).