From ba8f5ae215fbf3f312e7c449246d05c73e774d8d Mon Sep 17 00:00:00 2001 From: Francisc Balint <7178547+franciscbalint@users.noreply.github.com> Date: Sat, 17 Oct 2026 17:30:07 +0400 Subject: [PATCH] fix(ci): publish checkout pattern for CodeQL cache-poisoning Use refs/tags input for test/build jobs; keep tag_sha on release and registry publish jobs with environment: release (Pascal PR #18 lesson). Co-authored-by: Cursor --- .github/workflows/publish.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index d7d9972..75d3d8e 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -59,11 +59,12 @@ jobs: needs: [validate-tag] if: ${{ !cancelled() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') }} runs-on: ubuntu-latest + environment: release steps: - name: Checkout tag uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: - ref: ${{ needs.validate-tag.outputs.tag_sha }} + ref: refs/tags/${{ github.event.inputs.tag }} persist-credentials: false - name: Set up JDK 21 uses: actions/setup-java@b843ebf9b913146b38da2eaa7aeddf76074ae1ad # v6 @@ -121,6 +122,7 @@ jobs: needs: [validate-tag, publish] if: ${{ !cancelled() && !failure() }} runs-on: ubuntu-latest + environment: release permissions: contents: write steps: