From 74c3b635c1d12dbcb1fed5fd80cc1e6bb0433561 Mon Sep 17 00:00:00 2001 From: Ahmed Awan Date: Tue, 16 Dec 2025 13:59:14 +0500 Subject: [PATCH 1/3] [25.1] Remove ref from release-drafter workflow We realized that the release drafter checks out whatever version is on dev instead of the release branch that we want to target. --- .github/workflows/release-drafter.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml index 27ab7b43bb1..9d0e1d581da 100644 --- a/.github/workflows/release-drafter.yml +++ b/.github/workflows/release-drafter.yml @@ -22,7 +22,6 @@ jobs: steps: - uses: actions/checkout@v4 with: - ref: dev sparse-checkout: | lib/galaxy/version.py From a05abd0ff235d6008708f5aca6c2c802cf9e49e6 Mon Sep 17 00:00:00 2001 From: Ahmed Awan Date: Tue, 16 Dec 2025 16:23:27 +0500 Subject: [PATCH 2/3] add an optional workflow_dispatch trigger to release-drafter --- .github/workflows/release-drafter.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml index 9d0e1d581da..d47a59e4f0a 100644 --- a/.github/workflows/release-drafter.yml +++ b/.github/workflows/release-drafter.yml @@ -8,6 +8,7 @@ on: - 'release_*' pull_request_target: types: [opened, reopened, synchronize] + workflow_dispatch: permissions: contents: read From 19486b79fe4e60075e2d826fd360ab1db95d468f Mon Sep 17 00:00:00 2001 From: Ahmed Awan Date: Tue, 16 Dec 2025 19:12:31 +0500 Subject: [PATCH 3/3] only allow one draft at a time, and update it if it is the target version A limitation of the release-drafter (as I understand it) is that it only updates the latest draft, whether it is the dev draft at that point or the release draft, hence, resulting in duplicate release drafts if a PR against a release branch is merged. Here, we've added a step that checks and expects only 1 draft release at a time. This is cleaner because: while the only draft is `dev`, we only update that draft. Once, during the release process, `dev` becomes a `release_` branch, we do not create yet another draft for dev and instead just update the latest release branch draft, until the release will be published and then dev will start getting its own draft notes. --- .github/workflows/release-drafter.yml | 29 +++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml index d47a59e4f0a..b552e2d2a72 100644 --- a/.github/workflows/release-drafter.yml +++ b/.github/workflows/release-drafter.yml @@ -35,7 +35,36 @@ jobs: echo "version=${RELEASE_VERSION}" >> $GITHUB_OUTPUT echo "Galaxy release version: ${RELEASE_VERSION}" + - name: Check if we should update draft + id: check-draft + run: | + VERSION="${{ inputs.version || steps.galaxy-version.outputs.version }}" + + # Check if this version is already published + PUBLISHED=$(gh release view "v${VERSION}" --json isDraft --jq '.isDraft' 2>/dev/null || echo "not_found") + + if [ "$PUBLISHED" = "false" ]; then + echo "Published release v${VERSION} already exists. Skipping." + echo "skip=true" >> $GITHUB_OUTPUT + exit 0 + fi + + # Check if a draft exists for a DIFFERENT version (only one draft at a time) + EXISTING_DRAFT=$(gh release list --limit 50 --json tagName,isDraft --jq '.[] | select(.isDraft == true) | .tagName' | head -1) + + if [ -n "$EXISTING_DRAFT" ] && [ "$EXISTING_DRAFT" != "v${VERSION}" ]; then + echo "Draft release $EXISTING_DRAFT already exists (for different version). Skipping v${VERSION}." + echo "Only one draft release at a time is supported." + echo "skip=true" >> $GITHUB_OUTPUT + else + echo "Proceeding with draft for v${VERSION}." + echo "skip=false" >> $GITHUB_OUTPUT + fi + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - uses: release-drafter/release-drafter@v6 + if: steps.check-draft.outputs.skip == 'false' with: config-name: release-drafter.yml version: ${{ steps.galaxy-version.outputs.version }}