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
This commit is contained in:
Claude 2026-05-23 22:43:56 +00:00
parent 4e92c4f741
commit bd2f4f5c8b
No known key found for this signature in database

View file

@ -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: