From a79f2aa4a7be2d13ce753e8723e5f49c504652ba Mon Sep 17 00:00:00 2001 From: Moepchi Date: Sun, 27 Sep 2026 19:20:47 +0000 Subject: [PATCH] CI: pin actions to commit SHAs, pass release tag via env (S14) Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU --- .github/workflows/docker-publish.yml | 17 +++++++++++------ .github/workflows/safari-check.yml | 6 +++--- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index e24b65f..5601ade 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -20,30 +20,35 @@ jobs: steps: - name: Check out repository - uses: actions/checkout@v5 + uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5 with: submodules: recursive - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 + uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3 - name: Log in to Docker Hub - uses: docker/login-action@v3 + uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Determine image tags id: tags + # Passed via env, never spliced into the script: a tag name is + # user-controlled text and would otherwise run as shell code. + env: + EVENT_NAME: ${{ github.event_name }} + RELEASE_TAG: ${{ github.event.release.tag_name }} run: | TAGS="moepchi/webspeak3:latest" - if [ "${{ github.event_name }}" = "release" ]; then - TAGS="$TAGS,moepchi/webspeak3:${{ github.event.release.tag_name }}" + if [ "$EVENT_NAME" = "release" ]; then + TAGS="$TAGS,moepchi/webspeak3:$RELEASE_TAG" fi echo "tags=$TAGS" >> "$GITHUB_OUTPUT" - name: Build and push - uses: docker/build-push-action@v6 + uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6 with: context: . push: true diff --git a/.github/workflows/safari-check.yml b/.github/workflows/safari-check.yml index 9f6bcb2..a3330d7 100644 --- a/.github/workflows/safari-check.yml +++ b/.github/workflows/safari-check.yml @@ -28,10 +28,10 @@ jobs: steps: - name: Check out repository - uses: actions/checkout@v5 + uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5 - name: Set up Node.js - uses: actions/setup-node@v5 + uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5 with: node-version: 22 cache: npm @@ -67,7 +67,7 @@ jobs: - name: Upload Safari screenshots if: always() - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5 with: name: safari-client-screenshots path: test-results/safari-client-*.png