From 949ea5200d1b00e7c039fe8bf827bad61e3701e3 Mon Sep 17 00:00:00 2001 From: 4gray Date: Sat, 18 Jul 2026 19:14:15 +0200 Subject: [PATCH] ci(release): keep tag_name when patching rolling draft metadata MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PATCHing a draft release without tag_name makes GitHub drop the pending tag (the draft turns into untagged-), so the next run cannot find the rolling draft by tag and creates a duplicate — observed live on this PR's own drafts. Include tag_name in both PATCH payloads of the metadata step. Co-Authored-By: Claude Fable 5 --- .github/workflows/build-and-make.yaml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-make.yaml b/.github/workflows/build-and-make.yaml index 8274d5387..deb5fcbe6 100644 --- a/.github/workflows/build-and-make.yaml +++ b/.github/workflows/build-and-make.yaml @@ -1524,11 +1524,16 @@ jobs: -f target_commitish="${RELEASE_COMMITISH}" \ --jq '.body' || true)" + # tag_name MUST be included in every PATCH: updating a draft + # without it makes GitHub drop the pending tag (the draft + # becomes "untagged-"), which breaks the rolling-draft + # lookup on the next run. if [ -z "${GENERATED_NOTES}" ]; then jq -n \ + --arg tag "${RELEASE_TAG}" \ --arg name "${RELEASE_NAME}" \ --arg commitish "${RELEASE_COMMITISH}" \ - '{name: $name, target_commitish: $commitish}' | + '{tag_name: $tag, name: $name, target_commitish: $commitish}' | gh api -X PATCH "repos/${GITHUB_REPOSITORY}/releases/${RELEASE_ID}" --input - > /dev/null exit 0 fi @@ -1540,8 +1545,9 @@ jobs: fi jq -n \ + --arg tag "${RELEASE_TAG}" \ --arg name "${RELEASE_NAME}" \ --arg commitish "${RELEASE_COMMITISH}" \ --arg body "${FULL_BODY}" \ - '{name: $name, target_commitish: $commitish, body: ($body | .[0:120000])}' | + '{tag_name: $tag, name: $name, target_commitish: $commitish, body: ($body | .[0:120000])}' | gh api -X PATCH "repos/${GITHUB_REPOSITORY}/releases/${RELEASE_ID}" --input - > /dev/null