chore: probe the bot token on clone failure (temporary)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
9771f638b9
commit
eb2ea3f615
1 file changed
+9
-1
@@ -149,7 +149,15 @@ jobs:
|
||||
export GIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0=http.extraHeader \
|
||||
GIT_CONFIG_VALUE_0="Authorization: token $DOCS_REVIEW_BOT_TOKEN"
|
||||
src="$(mktemp -d)"
|
||||
git clone -q -- "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY.git" "$src"
|
||||
if ! git clone -q -- "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY.git" "$src"; then
|
||||
python3 -P -c 'import os, urllib.request, urllib.error
|
||||
req = urllib.request.Request(os.environ["GITHUB_SERVER_URL"] + "/api/v1/user", headers={"Authorization": "token " + os.environ["DOCS_REVIEW_BOT_TOKEN"]})
|
||||
try:
|
||||
r = urllib.request.urlopen(req, timeout=20); print("probe /user", r.status)
|
||||
except urllib.error.HTTPError as e:
|
||||
print("probe /user", e.code, e.read()[:300])'
|
||||
exit 1
|
||||
fi
|
||||
cd "$src"
|
||||
if [ "$EVENT" = "pull_request" ]; then
|
||||
git fetch -q origin "refs/pull/$PR/head"
|
||||
|
||||
Reference in new issue
Block a user