From 9b30580b94bb3b977b4b39b5ceacc1477ed34eba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?KARASZI=20Istv=C3=A1n?= Date: Sat, 19 Sep 2026 18:04:05 +0200 Subject: [PATCH 1/2] Stop the release when the branch already exists --- .github/workflows/release-prepare.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/release-prepare.yml b/.github/workflows/release-prepare.yml index e1c7b10..0d5ce53 100644 --- a/.github/workflows/release-prepare.yml +++ b/.github/workflows/release-prepare.yml @@ -43,6 +43,15 @@ jobs: echo "current=${current}" >> "${GITHUB_OUTPUT}" echo "new=${new}" >> "${GITHUB_OUTPUT}" + - name: Check that the release branch is free + env: + NEW: ${{ steps.version.outputs.new }} + run: | + if git ls-remote --exit-code --heads origin "release/v${NEW}" >/dev/null 2>&1; then + echo "The branch release/v${NEW} already exists. Delete it and run again." >&2 + exit 1 + fi + - name: Raise the version env: NEW: ${{ steps.version.outputs.new }} From 27e3dbb3977b598f178a64d01f57c40f393f43eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?KARASZI=20Istv=C3=A1n?= Date: Sat, 19 Sep 2026 18:05:00 +0200 Subject: [PATCH 2/2] Point the tag at the merge commit of the pull request --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index acc51a1..e73e048 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -50,7 +50,7 @@ jobs: steps: - uses: actions/checkout@v4 with: - ref: ${{ github.event_name == 'pull_request' && 'main' || github.ref }} + ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.merge_commit_sha || github.ref }} - name: Create the release run: |