From d8a833e508e40c92e657c9df8a366f5cbfa2c597 Mon Sep 17 00:00:00 2001 From: Daria Guy Date: Sun, 23 Nov 2025 18:07:57 +0200 Subject: [PATCH] Fail upload-packages only in public release --- .github/actions/upload-packages/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/upload-packages/action.yml b/.github/actions/upload-packages/action.yml index e5b1e7e..424c6f2 100644 --- a/.github/actions/upload-packages/action.yml +++ b/.github/actions/upload-packages/action.yml @@ -81,8 +81,8 @@ runs: sha256=$(shasum -a 256 $dir/*.zip | awk '{print $1}') # Only copy if binary doesn't exist - if aws s3api head-object --bucket ${{ inputs.BREW_S3_BUCKET }} --key homebrew/$dir >/dev/null 2>&1; - then + if aws s3api head-object --bucket ${{ inputs.BREW_S3_BUCKET }} --key homebrew/$dir >/dev/null 2>&1 && \ + [ "${{ inputs.release_type }}" = "public" ]; then echo "Error: Binary $dir already exists in S3. Public releases cannot overwrite existing packages." echo "Please check if this release has already been published." exit 1