Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions .github/workflows/bazel_example.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
permissions:
contents: read

name: Bazel Build

on:
Expand All @@ -9,17 +12,18 @@ on:
jobs:
build:
runs-on: ubuntu-24.04
container: gcr.io/gapic-images/googleapis:latest
container: gcr.io/gapic-images/googleapis:latest # zizmor: ignore[unpinned-images]

steps:
- name: Checkout code
uses: actions/checkout@v7
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
with:
submodules: 'recursive'
persist-credentials: false

- name: Bazel File Cache Setup
id: cache-bazel
uses: actions/cache@v6
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
with:
path: ~/.cache/bazel
key: ${{ runner.os }}-bazel-20210105-${{ secrets.CACHE_VERSION }}
Expand Down Expand Up @@ -81,7 +85,7 @@ jobs:
tests/Integration:talent \
tests/Integration:videointelligence --noshow_progress --cache_test_results=no

- uses: actions/upload-artifact@v5
- uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
if: ${{ failure() }}
with:
name: test-artifacts
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
permissions:
contents: read

name: Lint

on:
Expand All @@ -11,12 +14,12 @@ on:
jobs:
style:
name: PHP Style Check
uses: GoogleCloudPlatform/php-tools/.github/workflows/code-standards.yml@main
uses: GoogleCloudPlatform/php-tools/.github/workflows/code-standards.yml@main # zizmor: ignore[unpinned-uses]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why don't we just pin these? I don't particularly like annotations for a tool I don't use. Alternatively we can just ignore them without the annotation, as this tool is not being run regularly on CI (or is it?)

@g-husam g-husam Jul 11, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why don't we just pin these?

My thinking was that 1P deps (like googleapis or GCP or anything maintained by google and updated frequently) can be kept on latest (if repo owners prefer), for convenience. But if you prefer, can pin them. My assumption was that when depending on a shared workflow/image for builds, you are prob ok with always pulling the latest iff its a "trusted" 1P source, as they will prob be updated somewhat frequently and safer to be on latest than an old one.

But ofc these are all assumptions :) so lmk what you prefer.

as this tool is not being run regularly on CI (or is it?)

I think it will run on every PR once fully enforced

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we are enabling config:best-practices for Renovate in this PR, Renovate will automatically keep the SHAs up to date for us anyway. I agree with Brent that we should pin those 1P workflows and images to SHAs so we can get rid of the inline zizmor annotations entirely.

Otherwise looks great. Thanks for addressing the zizmor security findings and hardening our GitHub Actions.

A few highlights I appreciate here:

  • Enforcing the least-privilege principle by explicitly defining permissions: contents: read where they were previously absent.
  • Securing the checkout steps by explicitly disabling persist-credentials.
  • Pinning the action dependencies to immutable commit SHAs, and pairing that with the config:best-practices Renovate update to ensure the SHAs stay up to date.
  • Properly managing zizmor ignores for the trusted GoogleCloudPlatform/php-tools reusable workflows.

with:
path: src

static-analysis:
name: PHPStan Static Analysis
uses: GoogleCloudPlatform/php-tools/.github/workflows/static-analysis.yml@main
uses: GoogleCloudPlatform/php-tools/.github/workflows/static-analysis.yml@main # zizmor: ignore[unpinned-uses]
with:
autoload-file: tests/Unit/autoload.php
8 changes: 6 additions & 2 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
permissions:
contents: read

name: PhpUnit tests

on:
Expand All @@ -12,12 +15,13 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v7
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
with:
submodules: 'recursive'
persist-credentials: false

- name: Install PHP
uses: shivammathur/setup-php@v2
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2
with:
php-version: '8.2'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ permissions:
jobs:
next-release-label-check:
name: Check for "next release" label
uses: GoogleCloudPlatform/php-tools/.github/workflows/release-checks.yml@main
uses: GoogleCloudPlatform/php-tools/.github/workflows/release-checks.yml@main # zizmor: ignore[unpinned-uses]
if: github.event.pull_request.user.login == 'release-please[bot]'
with:
next-release-label-check: false
2 changes: 1 addition & 1 deletion renovate.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extends": [
"config:base",
"config:best-practices",
":disableDependencyDashboard",
":preserveSemverRanges"
],
Expand Down
Loading