From 62a9f8da28b1a2dbdaa9191689f72afecdb4b324 Mon Sep 17 00:00:00 2001 From: ChristophShyper <45788587+ChristophShyper@users.noreply.github.com> Date: Wed, 18 Feb 2026 22:02:43 +0100 Subject: [PATCH] :bug: Enhance release workflow to support manual dispatch and prevent duplicate tags --- .github/workflows/auto-create-release.yml | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/.github/workflows/auto-create-release.yml b/.github/workflows/auto-create-release.yml index 4f687a3..045d2f5 100644 --- a/.github/workflows/auto-create-release.yml +++ b/.github/workflows/auto-create-release.yml @@ -6,6 +6,7 @@ on: push: branches: - release/** + workflow_dispatch: permissions: contents: write @@ -13,7 +14,9 @@ permissions: jobs: release: - if: github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'release/') + if: >- + github.event_name == 'workflow_dispatch' || + (github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'release/')) name: Create Release runs-on: ubuntu-24.04-arm steps: @@ -35,8 +38,20 @@ jobs: run: | task lint task git:set-config - task version:tag-release - echo "REL_VERSION=$(task version:get)" >> "$GITHUB_OUTPUT" + REL_VERSION="$(task version:get)" + echo "REL_VERSION=${REL_VERSION}" >> "$GITHUB_OUTPUT" + + full_remote_sha="$(git ls-remote --tags origin "refs/tags/${REL_VERSION}" 2>/dev/null | awk '{print $1}' || true)" + if [ -n "${full_remote_sha}" ]; then + if [ "${GITHUB_EVENT_NAME}" = "workflow_dispatch" ]; then + echo "ℹ️ INFO: Full tag '${REL_VERSION}' already exists; skipping tag creation." + else + echo "❌ ERROR: Full tag '${REL_VERSION}' already exists; aborting" >&2 + exit 1 + fi + else + task version:tag-release + fi - name: Install Docker Buildx uses: docker/setup-buildx-action@v3