From 778d97aea830a6851f601d9d93ee399e04641294 Mon Sep 17 00:00:00 2001 From: Miguel Sanchez Gonzalez Date: Mon, 30 Mar 2026 10:05:51 +0200 Subject: [PATCH] fix(ci): prevent dirty git state in release workflow The workflow was using sed to modify .goreleaser.yaml when upload_taps was enabled, causing GoReleaser to fail with "git is in a dirty state". Changed to use environment variable SKIP_UPLOAD_TAPS with GoReleaser's envOrDefault template function. This preserves the same GitHub UI checkbox behavior while avoiding file modifications during the pipeline. Co-Authored-By: Claude Opus 4.6 --- .github/workflows/release.yml | 5 +---- .goreleaser.yaml | 8 ++++---- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fd2e5136..f7a21001 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -115,10 +115,6 @@ jobs: - name: Install Go tools run: make goreleaser repogen - - name: Override tap skip_upload - if: inputs.upload_taps == true - run: "sed -i 's/skip_upload: auto/skip_upload: false/' .goreleaser.yaml" - - name: Build release (tag) if: startsWith(github.ref, 'refs/tags/') || inputs.tag env: @@ -127,6 +123,7 @@ jobs: RSA_SIGNING_KEY_FILE: ${{ steps.signing-keys.outputs.key_dir }}/rsa-signing-key.pem GPG_SIGNING_KEY_FILE: ${{ steps.signing-keys.outputs.key_dir }}/gpg-signing-key.asc CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }} + SKIP_UPLOAD_TAPS: ${{ inputs.upload_taps == true && 'false' || 'auto' }} run: make release - name: Build snapshot (branch) diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 55d3bab6..31b47ee2 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -155,7 +155,7 @@ archives: brews: - name: platformsh-cli - skip_upload: auto + skip_upload: '{{ envOrDefault "SKIP_UPLOAD_TAPS" "auto" }}' repository: owner: upsun name: homebrew-tap @@ -186,7 +186,7 @@ brews: system "#{bin}/platform --version" - name: upsun-cli - skip_upload: auto + skip_upload: '{{ envOrDefault "SKIP_UPLOAD_TAPS" "auto" }}' repository: owner: upsun name: homebrew-tap @@ -218,7 +218,7 @@ brews: scoops: - name: platform - skip_upload: auto + skip_upload: '{{ envOrDefault "SKIP_UPLOAD_TAPS" "auto" }}' repository: owner: upsun name: homebrew-tap @@ -240,7 +240,7 @@ scoops: - extras/vcredist2022 - name: upsun - skip_upload: auto + skip_upload: '{{ envOrDefault "SKIP_UPLOAD_TAPS" "auto" }}' repository: owner: upsun name: homebrew-tap