Skip to content

Commit 4b00271

Browse files
committed
Probe GitHub Models for ContextBench model auth
1 parent 3cbb64b commit 4b00271

1 file changed

Lines changed: 66 additions & 0 deletions

File tree

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: ContextBench GitHub Models Probe
2+
3+
on:
4+
push:
5+
branches: [master]
6+
paths:
7+
- .github/workflows/contextbench-github-models-probe.yml
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: read
12+
models: read
13+
14+
jobs:
15+
probe:
16+
runs-on: ubuntu-latest
17+
timeout-minutes: 10
18+
env:
19+
ROOT: /tmp/contextbench-github-models-probe
20+
steps:
21+
- name: Probe model catalog and smoke calls
22+
env:
23+
GH_TOKEN: ${{ github.token }}
24+
run: |
25+
set -euo pipefail
26+
mkdir -p "$ROOT"
27+
api=https://models.github.ai
28+
curl -sS -L \
29+
-H "Accept: application/vnd.github+json" \
30+
-H "Authorization: Bearer $GH_TOKEN" \
31+
-H "X-GitHub-Api-Version: 2026-03-10" \
32+
"$api/catalog/models" > "$ROOT/catalog.json"
33+
node - <<'NODE'
34+
const fs = require('fs');
35+
const raw = fs.readFileSync(process.env.ROOT + '/catalog.json', 'utf8');
36+
let json;
37+
try { json = JSON.parse(raw); } catch (error) { console.error(raw.slice(0, 2000)); throw error; }
38+
const list = Array.isArray(json) ? json : (json.models || json.data || []);
39+
const ids = list.map((m) => m.id || m.name || m.model).filter(Boolean);
40+
const interesting = ids.filter((id) => /openai|gpt-5|gpt-5\.4|mini/i.test(id));
41+
fs.writeFileSync(process.env.ROOT + '/interesting-models.json', JSON.stringify(interesting, null, 2));
42+
console.log(JSON.stringify({ total: ids.length, interesting: interesting.slice(0, 80) }, null, 2));
43+
NODE
44+
for model in openai/gpt-5.4-mini openai/gpt-5-mini gpt-5.4-mini gpt-5-mini; do
45+
safe=$(echo "$model" | tr '/.' '__')
46+
echo "Trying $model"
47+
code=$(curl -sS -L -o "$ROOT/smoke-$safe.json" -w '%{http_code}' \
48+
-H "Accept: application/vnd.github+json" \
49+
-H "Authorization: Bearer $GH_TOKEN" \
50+
-H "X-GitHub-Api-Version: 2026-03-10" \
51+
-H "Content-Type: application/json" \
52+
"$api/inference/chat/completions" \
53+
-d "{\"model\":\"$model\",\"messages\":[{\"role\":\"user\",\"content\":\"Return JSON: {\\\"ok\\\": true}\"}],\"response_format\":{\"type\":\"json_object\"},\"max_tokens\":32}") || code=000
54+
echo "$model $code" | tee -a "$ROOT/smoke-status.txt"
55+
done
56+
if grep -E ' 2[0-9][0-9]$' "$ROOT/smoke-status.txt"; then
57+
exit 0
58+
fi
59+
exit 1
60+
- name: Upload GitHub Models probe artifacts
61+
if: always()
62+
uses: actions/upload-artifact@v4
63+
with:
64+
name: contextbench-github-models-probe
65+
path: /tmp/contextbench-github-models-probe
66+
retention-days: 14

0 commit comments

Comments
 (0)