From 32b4e718b2ed36e1b31cc54b080d4f3854fd2c9e Mon Sep 17 00:00:00 2001 From: Hironori Takahashi Date: Wed, 2 Dec 2026 11:59:34 +0900 Subject: [PATCH 1/2] ci: adopt the shared zizmor workflow and fix its findings Adds a job calling h13/.github ci-zizmor.yml (v3.1.0, SHA-pinned, default medium gate) and fixes every >=medium finding so the gate starts green. See the PR description for the finding-by-finding list. --- .github/workflows/ci.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 59370ab..fe75168 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -82,3 +82,6 @@ jobs: run: go install golang.org/x/vuln/cmd/govulncheck@v1.8.0 - name: Run govulncheck run: govulncheck ./... + + zizmor: + uses: h13/.github/.github/workflows/ci-zizmor.yml@c807de1510e8d223f352555ddcbf6a1a78fe51eb # v3.1.0 From 96cf18d0964896cdad95e6af230f4359756ed1ff Mon Sep 17 00:00:00 2001 From: Hironori Takahashi Date: Wed, 2 Dec 2026 12:06:24 +0900 Subject: [PATCH 2/2] fix: harden the composite action against injection zizmor in CI scans the whole repo, not just .github/workflows, and flagged action.yml: - github.action_ref was interpolated into the install command line; it now arrives via env. - the credentials file path moved from GITHUB_ENV (writable by anything later in the job) to a step output consumed via env. --- action.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index 9c55296..a20f5e3 100644 --- a/action.yml +++ b/action.yml @@ -59,22 +59,27 @@ runs: - name: Install gtm-users shell: bash - run: go install github.com/h13/gtm-users/cmd/gtm-users@${{ github.action_ref || 'latest' }} + env: + ACTION_REF: ${{ github.action_ref || 'latest' }} + run: go install "github.com/h13/gtm-users/cmd/gtm-users@${ACTION_REF}" - name: Write credentials file if: inputs.credentials != '' + id: credfile shell: bash env: CREDENTIALS_CONTENT: ${{ inputs.credentials }} run: | CRED_FILE=$(mktemp) printf '%s' "$CREDENTIALS_CONTENT" > "$CRED_FILE" - echo "GTMUSERS_CREDENTIALS_FILE=$CRED_FILE" >> "$GITHUB_ENV" + # A step output instead of GITHUB_ENV: nothing else can inject into it. + echo "file=$CRED_FILE" >> "$GITHUB_OUTPUT" - name: Run gtm-users id: run shell: bash env: + GTMUSERS_CREDENTIALS_FILE: ${{ steps.credfile.outputs.file }} INPUT_COMMAND: ${{ inputs.command }} INPUT_CONFIG: ${{ inputs.config }} INPUT_FORMAT: ${{ inputs.format }} @@ -138,6 +143,8 @@ runs: - name: Cleanup credentials if: always() && inputs.credentials != '' shell: bash + env: + GTMUSERS_CREDENTIALS_FILE: ${{ steps.credfile.outputs.file }} run: rm -f "$GTMUSERS_CREDENTIALS_FILE" - name: Comment on PR