From cd4b7aa63d849ccdc6a27a9e6d73c6948d928727 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=B6gl-Brunner=20Michel?= Date: Fri, 13 Nov 2026 12:56:10 +0100 Subject: [PATCH] pr-script-test: probe whether the job token can read another repo's release --- .github/workflows/scripts/pve-run-script.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/scripts/pve-run-script.sh b/.github/workflows/scripts/pve-run-script.sh index bc19d5259..1ac2cf25c 100644 --- a/.github/workflows/scripts/pve-run-script.sh +++ b/.github/workflows/scripts/pve-run-script.sh @@ -478,6 +478,10 @@ gh_quota() { jq -r '.rate | "\(.remaining) of \(.limit) left, resets in \(((.reset - now) / 60) | floor) min"' 2>/dev/null || echo "unknown" } echo "GitHub API quota: token $(gh_quota "${GH_API_TOKEN:-}") ยท no token $(gh_quota "")" +# Can the token read another owner's release, as every install does? +[[ -n "${GH_API_TOKEN:-}" ]] && echo "Token reads another repo's release: $(curl -s --max-time 10 -o /tmp/gh-probe.$$ -w '%{http_code}' \ + -H "Authorization: Bearer $GH_API_TOKEN" https://api.github.com/repos/cli/cli/releases/latest) $(jq -r '.message // .tag_name' /tmp/gh-probe.$$ 2>/dev/null)" +rm -f /tmp/gh-probe.$$ # --- Answers for the script's questions ------------------------------------------ # Nobody types into CI, so anything the install asks has to be answered up front.