mirror of
https://github.com/zhom/donutbrowser.git
synced 2026-09-27 03:31:48 +02:00
chore: linting
This commit is contained in:
@@ -121,14 +121,25 @@ jobs:
|
||||
response_format: { type: "json_object" }
|
||||
}')
|
||||
|
||||
RESPONSE=$(curl -fsSL https://models.github.ai/inference/chat/completions \
|
||||
# Never use curl -f here: a transport or quota error (402 once the repo's
|
||||
# GitHub Models allowance is spent) must not abort the job. The model
|
||||
# half of this check is fail-open, and the deterministic trailer scan
|
||||
# below still runs regardless.
|
||||
STATUS=$(curl -sSL -o /tmp/response.json -w '%{http_code}' \
|
||||
https://models.github.ai/inference/chat/completions \
|
||||
-H "Authorization: Bearer $GH_MODELS_TOKEN" \
|
||||
-H "Accept: application/vnd.github+json" \
|
||||
-H "X-GitHub-Api-Version: 2026-03-10" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "$PAYLOAD")
|
||||
-d "$PAYLOAD" || echo "000")
|
||||
|
||||
jq -r '.choices[0].message.content // empty' <<< "$RESPONSE" > /tmp/raw.txt
|
||||
if [ "$STATUS" != "200" ]; then
|
||||
echo "::warning::GitHub Models returned HTTP $STATUS; treating as compliant"
|
||||
echo '{"compliant": true, "violations": []}' > /tmp/result.json
|
||||
exit 0
|
||||
fi
|
||||
|
||||
jq -r '.choices[0].message.content // empty' /tmp/response.json > /tmp/raw.txt || : > /tmp/raw.txt
|
||||
|
||||
# Strip accidental markdown fences and parse. On parse failure, fall
|
||||
# back to compliant so a flaky model never closes a legitimate PR.
|
||||
|
||||
Reference in New Issue
Block a user