Skip to content

Commit 839e00f

Browse files
committed
ci: pass MODELS_PAT to ai-inference instead of GITHUB_TOKEN
The auto-injected GITHUB_TOKEN returns 403 (no body) from the GitHub Models API on orgs that don't have Models enabled at the org level (yao-pkg is on the free plan; the toggle isn't available). A fine-grained PAT scoped only to account-level 'Models: Read' authenticates as the user and works regardless of org policy. See actions/ai-inference#155 for the same symptom and fix. The new MODELS_PAT secret has the minimum possible permission and no third-party trust — fundamentally different from the OpenAI key it replaces.
1 parent 80d4e90 commit 839e00f

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

.github/workflows/patch-node.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,12 @@ jobs:
9494
# CoT tokens. 1M input / 32K output / "high" rate-limit tier.
9595
model: openai/gpt-4.1
9696
max-completion-tokens: 16000
97+
# The auto-injected GITHUB_TOKEN cannot access GitHub Models on
98+
# orgs that don't have Models enabled at the org/enterprise level
99+
# (returns 403 with no body). A fine-grained PAT scoped only to
100+
# account-level "Models: Read" works regardless of org policy.
101+
# See: https://github.com/actions/ai-inference/issues/155
102+
token: ${{ secrets.MODELS_PAT }}
97103

98104
- name: Apply AI resolutions
99105
if: steps.apply.outputs.needs_ai == 'true'

0 commit comments

Comments
 (0)