Loading...
Loading...
Authenticate to GitHub and fix auth problems — the shared primitive every other github-* skill relies on. Use this BEFORE any create/query when GitHub auth is uncertain, and whenever a GitHub API call misbehaves: a call returns 401 or 403, "gh not logged in" / token missing, results come back empty or from the wrong repo. Covers the two supported methods (gh CLI via `gh auth token`, or GH_TOKEN env var), a one-line PowerShell verify snippet against the repo API, and a 401/403/wrong-repo troubleshooting table. Invoke when someone says "I'm getting a 401 from GitHub", "github-create-issues says no token", "gh auth failing", or "check my GitHub login before we run".
npx skill4agent add thodsaphonsonthiphin/workflow-daily-work github-authcreate_github_issues.pyghgh auth tokengh auth login # one-time setup
$token = gh auth token # get the current tokenAuthorization: Bearer <token>gh$env:GH_TOKEN = "<your-pat>"create_github_issues.pyGH_TOKENgh auth tokenGH_TOKEN$env:GH_OWNER = "Cartagena365" # org or user name — NOT a URL
$env:GH_REPO = "GlassHull" # repo name — NOT a URLgh api "repos/$env:GH_OWNER/$env:GH_REPO" --jq '.full_name'Cartagena365/GlassHullpowershell -ExecutionPolicy Bypass -File "${CLAUDE_PLUGIN_ROOT}/scripts/setup_check_github.ps1"| Symptom | Cause | Fix |
|---|---|---|
| HTTP 401 Unauthorized | No token, or it expired | |
| HTTP 403 Forbidden | Token is valid but lacks rights | PAT scope missing Issues (Read & Write) — reissue with that scope. For fine-grained PAT: confirm the repo is included in the token's access list. |
| repo not found / 404 | Wrong owner/repo name, or private repo the token can't see | Check |
| "gh: command not found" | gh CLI not installed | Install from https://cli.github.com, then |
| 200 but wrong repo | Env vars point at the wrong place | Re-check |
gh api repos/...GH_OWNERGH_REPO