docs: install section with the caller and inputs; drop workflow probes
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
decf41a6e5
commit
cdfe3ed1ef
2 files changed
+56
-33
No files matched your search
@@ -55,6 +55,9 @@ on:
|
||||
type: string
|
||||
required: false
|
||||
default: claude-sonnet-5-5
|
||||
# Gitea 28.3 does not tell a called workflow its own ref (github.workflow_ref and
|
||||
# job_workflow_sha are empty, and GITHUB_WORKFLOW_SHA is the caller's commit), so
|
||||
# the caller names the tool version twice.
|
||||
tool_ref:
|
||||
description: "Branch or tag of docs-review to run; keep it equal to the @ref in uses:"
|
||||
type: string
|
||||
@@ -102,19 +105,10 @@ jobs:
|
||||
# a pull request cannot replace the tool.
|
||||
steps:
|
||||
- name: Versions
|
||||
env:
|
||||
PROBE_WORKFLOW_REF: ${{ github.workflow_ref }}
|
||||
PROBE_JOB_WORKFLOW_SHA: ${{ github.job_workflow_sha }}
|
||||
PROBE_JOB_WORKFLOW_REF: ${{ github.job_workflow_ref }}
|
||||
run: |
|
||||
python3 --version
|
||||
git --version
|
||||
node --version
|
||||
echo "probe workflow_ref=[$PROBE_WORKFLOW_REF]"
|
||||
echo "probe job_workflow_sha=[$PROBE_JOB_WORKFLOW_SHA]"
|
||||
echo "probe job_workflow_ref=[$PROBE_JOB_WORKFLOW_REF]"
|
||||
echo "probe RUNNER_TEMP=[${RUNNER_TEMP:-}]"
|
||||
env | grep -E '^GITHUB_' | grep -viE 'TOKEN' | sort | sed 's/^/probe /'
|
||||
|
||||
- name: Fetch docs-review
|
||||
run: |
|
||||
@@ -150,19 +144,8 @@ jobs:
|
||||
GIT_CONFIG_VALUE_0="Authorization: token $DOCS_REVIEW_BOT_TOKEN"
|
||||
src="$(mktemp -d)"
|
||||
if ! git clone -q -- "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY.git" "$src"; then
|
||||
python3 -P -c 'import os, urllib.request, urllib.error
|
||||
for path in ("/user", "/repos/" + os.environ["GITHUB_REPOSITORY"]):
|
||||
req = urllib.request.Request(os.environ["GITHUB_SERVER_URL"] + "/api/v1" + path, headers={"Authorization": "token " + os.environ["DOCS_REVIEW_BOT_TOKEN"]})
|
||||
try:
|
||||
r = urllib.request.urlopen(req, timeout=20); print("probe", path, r.status)
|
||||
except urllib.error.HTTPError as e:
|
||||
print("probe", path, e.code, e.read()[:300])'
|
||||
url="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY.git"
|
||||
GIT_CONFIG_VALUE_0="Authorization: Bearer $DOCS_REVIEW_BOT_TOKEN" git ls-remote -q "$url" >/dev/null 2>&1 && echo "probe bearer ok" || echo "probe bearer fail"
|
||||
basic="$(printf 'docs-review-bot:%s' "$DOCS_REVIEW_BOT_TOKEN" | base64 -w0)"
|
||||
GIT_CONFIG_VALUE_0="Authorization: Basic $basic" git ls-remote -q "$url" >/dev/null 2>&1 && echo "probe basic ok" || echo "probe basic fail"
|
||||
GIT_CONFIG_COUNT=0 git ls-remote -q "$GITHUB_SERVER_URL/Civilytics/docs-review.git" >/dev/null 2>&1 && echo "probe anon public ok" || echo "probe anon public fail"
|
||||
GIT_CONFIG_VALUE_0="Authorization: token $DOCS_REVIEW_BOT_TOKEN" git ls-remote -q "$GITHUB_SERVER_URL/Civilytics/docs-review.git" >/dev/null 2>&1 && echo "probe token public ok" || echo "probe token public fail"
|
||||
echo "::error::the bot token could not clone $GITHUB_REPOSITORY; it needs the" \
|
||||
"write:repository scope and write access to the repository"
|
||||
exit 1
|
||||
fi
|
||||
cd "$src"
|
||||
|
||||
Reference in new issue
Block a user