From 06727f92b2070c346d3feab0018a4070f59a7069 Mon Sep 17 00:00:00 2001 From: Yves Fridelance Date: Thu, 26 Feb 2026 16:11:46 +0100 Subject: [PATCH] fix: only publish to PSGallery on push to main, not on PRs The publish step ran on both PR builds and main pushes, causing the PR build to publish first and the subsequent main push to fail with a 409 Conflict since the version was already on PSGallery. Co-Authored-By: Claude Opus 4.6 --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2972d1a..1fe7fe3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -64,7 +64,7 @@ jobs: path: ./dist/YFridelance.PS.ModuleFactory/ - name: Publish to PowerShell Gallery - if: matrix.os == 'ubuntu-latest' + if: matrix.os == 'ubuntu-latest' && github.event_name == 'push' shell: pwsh env: PSGALLERY_API_KEY: ${{ secrets.PSGALLERY_API_KEY }}