discourse-release: treat "External has already been taken" as already announced #5

Merged
jcoffey-dev merged 1 commits from fix/announce-duplicate-check into main 2026-10-07 17:29:09 +00:00
+3 -1
View File
@@ -57,7 +57,9 @@ case "$status" in
url="$FORUM/t/$(jq -r '.topic_slug' <<<"$body")/$(jq -r '.topic_id' <<<"$body")"
echo "announced: $url" ;;
422)
if jq -e '.errors | tostring | test("External ID"; "i")' <<<"$body" >/dev/null; then
# Discourse words this "External has already been taken" (older versions:
# "External ID ..."); a racing run can also hit the title check first.
if jq -e '.errors | tostring | test("External( ID| has already been taken)|title has already been used"; "i")' <<<"$body" >/dev/null; then
echo "already announced (external_id $external_id); nothing to do"
exit 0
fi