publish-to-ghas skill: document that a gh CLI OAuth token (repo scope) works without a PAT (PAT-restricted orgs)
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 88/100
- Issue type
- Documentation
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- github, markdown, powershell, shell
- Domain
- documentation
Research direction
Read skills/publish-to-ghas/SKILL.md, starting with the Prerequisites, Step 1, Security model, and troubleshooting sections. Document both PAT and existing gh CLI OAuth-token paths, including the provided PowerShell example and PAT-restricted organization guidance, then verify the instructions remain consistent with the security model.
Written by the indexing model from the issue text.
Description
Summary
The publish-to-ghas skill (skills/publish-to-ghas/SKILL.md) presents a GitHub PAT with security_events as the credential. In organizations that prohibit PAT creation (common in enterprise GHE), this reads as "you are blocked" — when in fact an existing gh CLI OAuth token with repo scope publishes successfully. The skill already states this fact, but only as a parenthetical in the Security model; the Prerequisites and Step 1 sections do not reflect it, so an operator following the happy path concludes they need a PAT they cannot create.
Where the gap is
- Security model (correct, but easy to miss):
A classic or fine-grained GitHub personal access token carrying
security_eventswrite (repoalso grants it for private repositories) is sent as a bearer token. - Prerequisites (PAT-only):
A GitHub personal access token with
security_eventswrite, stored in an environment variable. - Step 1 — Set the token only shows a
Read-Host/read -rspaste, implying the operator already holds a PAT. Nogh-token source is shown.
Evidence it works without a PAT
On a private repo hosted on a <slug>.ghe.com instance where the org forbids authoring PATs, publishing with the token from the already-authenticated gh CLI (scopes gist, read:org, repo, workflow — note: no security_events) succeeded end to end:
publish-to-ghas-> HTTP 202 Accepted- analysis
processing_statuspolled tocomplete, zero errors - 117 alerts surfaced in code scanning with full
security_severity_level(8 critical / 68 high / 41 medium)
The repo scope alone was sufficient for a private repo; security_events was never present. (Separately, gh auth refresh -h <slug>.ghe.com -s security_events reported success but the authoritative X-OAuth-Scopes header showed the scope was silently dropped — the GHE OAuth app was not permitted to grant it. So for that class of org, the gh OAuth repo token is the only viable path.)
Proposed doc changes (skill-only, no code)
- Prerequisites — replace the PAT-only line with the fuller credential menu:
A token with code-scanning upload rights, in an env var. A classic/fine-grained PAT with
security_eventsworks; for a private repo, classicreposcope alone is sufficient, so an existingghCLI OAuth token (gh auth token -h <host>) withrepoworks with no PAT — important for orgs that prohibit PAT creation. - Step 1 — Set the token — add a
gh-token source example alongside the manual paste:# If already signed in with the gh CLI (repo scope), no PAT needed: $env:GHAS_TOKEN = gh auth token -h <slug>.ghe.com # or github.com - Edge cases / Troubleshooting — add: "Org forbids PATs? Use the
ghCLI OAuth token (reposcope). Do not chasesecurity_eventsviagh auth refresh— some GHE OAuth apps silently drop it; checkX-OAuth-ScopesonGET /user."
This keeps the security guidance intact (least privilege, bearer-only, never echoed) while removing the false "PAT required" wall for PAT-restricted orgs.
- Dominant language
- C#
- Stars
- 226
- Forks
- 108
- Avg merge
- 3d 8h
- Merged PRs (30d)
- 6
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/sarif-sdk
-
bug javascript
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
emit-sarif: document the TF_BUILD -> GHAZDO publishability coupling (local runs cannot be published) Open
Difficulty 1/5 Under an hour Newbie friendliness 88/100
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
All issues in microsoft/sarif-sdk
Similar issues
-
type/automation type/tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
t/bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
ci-failure-cause test-failure
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
area:auth FE mvp P3
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
klasolsson81/jobbliggaren#1788 ·