diff --git a/bin/check-versions b/bin/check-versions index ef81e29..0d12005 100755 --- a/bin/check-versions +++ b/bin/check-versions @@ -131,6 +131,17 @@ check_package() { return 1 fi + # Different is not the same as newer. A checkout behind the published state + # — a stale branch, an un-pulled host — otherwise queues a REBUILD OF AN + # OLDER VERSION every cycle: the builder produces it, and promotion refuses + # it because that exact filename is already published with different bytes. + # If the artifact for this version already exists in the channel, there is + # nothing to build regardless of which direction the versions differ. + if compgen -G "$REPO_ROOT/$mirror/$ARCH/${pkg}-${pkgbuild_version}-*.pkg.tar."[!s]* >/dev/null 2>&1; then + print_warning "$pkg $pkgbuild_version is already published — this checkout is behind the channel; not queueing" + return 1 + fi + return 0 } diff --git a/helpers/basecamp-notifier.sh b/helpers/basecamp-notifier.sh index 98470e2..aa8298f 100644 --- a/helpers/basecamp-notifier.sh +++ b/helpers/basecamp-notifier.sh @@ -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() {