ci(release): keep tag_name when patching rolling draft metadata

PATCHing a draft release without tag_name makes GitHub drop the
pending tag (the draft turns into untagged-<hash>), 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 <noreply@anthropic.com>
This commit is contained in:
4grayandClaude Fable 5 committed 2026-07-18 19:14:15 +02:00
1 parent 0703f9dacb
commit 949ea5200d
1 file changed
+8 -2
+8 -2
View File
@@ -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-<hash>"), 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