Fix silent notifications and stop stale checkouts queueing rebuild loops
Two failures from the first live run: notify_basecamp declared 'local BASECAMP_CHATBOT_URL' and then called release_chatbot_url, whose fallback reads that same global — bash locals are visible to called functions, so the fallback saw the empty local and every notification silently went nowhere for anyone with only the legacy variable set. The local is now named 'url'. check-versions compared PKGBUILD and published versions with !=, so a checkout BEHIND the channel queued a rebuild of an older version every cycle: the builder produced it and promotion refused it, because that exact filename is already published with different bytes. It now skips (with a warning naming the package) when an artifact for the PKGBUILD's version already exists in the channel, whichever direction the versions differ.
This commit is contained in:
@@ -17,17 +17,21 @@ release_chatbot_url() {
|
||||
|
||||
notify_basecamp() {
|
||||
local content="$1"
|
||||
local BASECAMP_CHATBOT_URL
|
||||
BASECAMP_CHATBOT_URL=$(release_chatbot_url)
|
||||
# NOT named BASECAMP_CHATBOT_URL: bash locals are visible to called
|
||||
# functions, so declaring that name here would shadow the global that
|
||||
# release_chatbot_url falls back to — and every notification would silently
|
||||
# go nowhere for anyone who has only the legacy variable set.
|
||||
local url
|
||||
url=$(release_chatbot_url)
|
||||
|
||||
if [[ -z "${BASECAMP_CHATBOT_URL:-}" ]]; then
|
||||
if [[ -z "$url" ]]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
curl -s -o /dev/null \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "$(jq -n --arg content "$content" '{content: $content}')" \
|
||||
"$BASECAMP_CHATBOT_URL" 2>/dev/null || true
|
||||
"$url" 2>/dev/null || true
|
||||
}
|
||||
|
||||
basecamp_html_escape() {
|
||||
|
||||
Reference in New Issue
Block a user