From bd2f4f5c8bfd27d78506a7ced75436cdab14cb69 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 23 May 2026 22:43:56 +0000 Subject: [PATCH] fix(ci): harden terraform publish workflow for zizmor Pin actions/checkout to a SHA, disable credential persistence (the push uses its own token), and pass the version input via env instead of interpolating it into a run block (template-injection). https://claude.ai/code/session_01KprYNJjvub4vNYr4d2xCQ6 --- .github/workflows/terraform-modules-publish.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/terraform-modules-publish.yml b/.github/workflows/terraform-modules-publish.yml index 75cb1251d2b..3c9a0ca2c70 100644 --- a/.github/workflows/terraform-modules-publish.yml +++ b/.github/workflows/terraform-modules-publish.yml @@ -50,17 +50,20 @@ jobs: repo: terraform-google-litellm steps: - name: Validate version input + env: + VERSION: ${{ inputs.version }} run: | set -euo pipefail - if ! printf '%s' "${{ inputs.version }}" | grep -Eq '^v[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?$'; then + if ! printf '%s' "$VERSION" | grep -Eq '^v[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?$'; then echo "version must be semver with a leading v (e.g. v1.86.0)" >&2 exit 1 fi - name: Checkout (full history for subtree split) - uses: actions/checkout@v4 + uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 with: fetch-depth: 0 + persist-credentials: false - name: Mirror ${{ matrix.prefix }} → BerriAI/${{ matrix.repo }} env: