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