From 53ce47ed816fb79557f2e6f5b13e9702a398694b Mon Sep 17 00:00:00 2001 From: Kai Schwarz Date: Mon, 24 Aug 2026 16:31:37 +0200 Subject: [PATCH] fix(repo-settings): apply the unreadable guard to the topics probe too MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit RSRMID-2988 fixed this idiom in the secrets and variables probes and missed the topics one at line 187, which has exactly the same defect: on a 403 `gh api` exits non-zero *and* prints the error JSON to stdout, so `$(cmd || echo unknown)` captures that JSON with `unknown` appended, never equals `unknown`, and compare() reports drift with a JSON blob as the observed value instead of counting the row as unreadable. Topics happens to be readable on a public repository with the current token, which is why the run stayed clean and the bug stayed hidden — it would have surfaced the first time this ran against a repository or token where it was not. Brings this copy back in line with the template, where all three probes are fixed together under the same issue. RSRMID-2989 --- scripts/repo-settings.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/repo-settings.sh b/scripts/repo-settings.sh index 883bc99..798d6ed 100755 --- a/scripts/repo-settings.sh +++ b/scripts/repo-settings.sh @@ -184,7 +184,7 @@ if [[ "$MODE" == "apply" ]]; then gh api --method PUT "repos/${REPO}/topics" --input - >/dev/null || die "failed to set topics" fi -got_topics=$(gh api "repos/${REPO}/topics" --jq '.names | sort | join(" ")' 2>/dev/null || echo unknown) +got_topics=$(gh api "repos/${REPO}/topics" --jq '.names | sort | join(" ")' 2>/dev/null) || got_topics=unknown compare "topics" "$want_topics" "$got_topics" # --- security ----------------------------------------------------------------