docs: add project scope to gh auth setup
- Add read:project,project scopes to gh auth in install scripts - Update troubleshooting docs for missing scopes - Enable GitHub Projects access for workspace management Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
99897636a1
commit
b1aada9b0e
4 changed files with 42 additions and 10 deletions
|
|
@ -136,8 +136,8 @@ Defined in `repos.yaml`:
|
||||||
## Troubleshooting
|
## Troubleshooting
|
||||||
|
|
||||||
- **"core: command not found"** → `make install-core` (builds from https://github.com/host-uk/core)
|
- **"core: command not found"** → `make install-core` (builds from https://github.com/host-uk/core)
|
||||||
- **"gh: command not found"** → `brew install gh && gh auth login -h github.com -p https -s workflow,repo,read:org`
|
- **"gh: command not found"** → `brew install gh && gh auth login -h github.com -p https -s workflow,repo,read:org,read:project,project`
|
||||||
- **"refusing to allow an OAuth App to create or update workflow"** → `gh auth refresh -h github.com -s workflow`
|
- **"refusing to allow..." or "missing required scopes"** → `gh auth refresh -h github.com -s workflow,read:project,project`
|
||||||
- **Clone failures** → `ssh -T git@github.com` to verify SSH keys
|
- **Clone failures** → `ssh -T git@github.com` to verify SSH keys
|
||||||
|
|
||||||
## This Repo's Scope
|
## This Repo's Scope
|
||||||
|
|
|
||||||
|
|
@ -136,12 +136,12 @@ make install-core
|
||||||
|
|
||||||
**"gh: command not found"**
|
**"gh: command not found"**
|
||||||
```bash
|
```bash
|
||||||
brew install gh && gh auth login -h github.com -p https -s workflow,repo,read:org
|
brew install gh && gh auth login -h github.com -p https -s workflow,repo,read:org,read:project,project
|
||||||
```
|
```
|
||||||
|
|
||||||
**"refusing to allow an OAuth App to create or update workflow"**
|
**"refusing to allow an OAuth App to create or update workflow"** or **"missing required scopes"**
|
||||||
```bash
|
```bash
|
||||||
gh auth refresh -h github.com -s workflow
|
gh auth refresh -h github.com -s workflow,read:project,project
|
||||||
```
|
```
|
||||||
|
|
||||||
**Clone failures**
|
**Clone failures**
|
||||||
|
|
|
||||||
|
|
@ -102,6 +102,28 @@ function Main {
|
||||||
}
|
}
|
||||||
|
|
||||||
Write-Info "Dependencies installed!"
|
Write-Info "Dependencies installed!"
|
||||||
|
Write-Host ""
|
||||||
|
|
||||||
|
# Configure GitHub CLI if not already authenticated
|
||||||
|
if (Test-Command gh) {
|
||||||
|
$authStatus = gh auth status 2>&1 | Out-String
|
||||||
|
if ($authStatus -match "not logged in") {
|
||||||
|
Write-Info "Configuring GitHub CLI..."
|
||||||
|
Write-Host "You'll need to authenticate with GitHub."
|
||||||
|
gh auth login -h github.com -p https -s workflow,repo,read:org,read:project,project
|
||||||
|
} else {
|
||||||
|
# Check for missing scopes
|
||||||
|
$missingScopes = @()
|
||||||
|
if ($authStatus -notmatch "workflow") { $missingScopes += "workflow" }
|
||||||
|
if ($authStatus -notmatch "read:project") { $missingScopes += "read:project,project" }
|
||||||
|
|
||||||
|
if ($missingScopes.Count -gt 0) {
|
||||||
|
Write-Warn "GitHub CLI missing scopes: $($missingScopes -join ', ')"
|
||||||
|
Write-Host "Run: gh auth refresh -h github.com -s workflow,read:project,project"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Write-Host ""
|
Write-Host ""
|
||||||
Write-Host "Next: Run '.\scripts\install-core.ps1' to install the core CLI"
|
Write-Host "Next: Run '.\scripts\install-core.ps1' to install the core CLI"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -295,12 +295,22 @@ main() {
|
||||||
echo "You'll need to authenticate with GitHub."
|
echo "You'll need to authenticate with GitHub."
|
||||||
echo "When prompted, select HTTPS and add the 'workflow' scope."
|
echo "When prompted, select HTTPS and add the 'workflow' scope."
|
||||||
echo ""
|
echo ""
|
||||||
gh auth login -h github.com -p https -s workflow,repo,read:org
|
gh auth login -h github.com -p https -s workflow,repo,read:org,read:project,project
|
||||||
else
|
else
|
||||||
# Check if workflow scope is present
|
# Check if required scopes are present
|
||||||
if ! gh auth status 2>&1 | grep -q workflow; then
|
local auth_status=$(gh auth status 2>&1)
|
||||||
warn "GitHub CLI missing 'workflow' scope (needed for pushing repos with GitHub Actions)"
|
local missing_scopes=""
|
||||||
echo "Run: gh auth refresh -h github.com -s workflow"
|
|
||||||
|
if ! echo "$auth_status" | grep -q workflow; then
|
||||||
|
missing_scopes="workflow"
|
||||||
|
fi
|
||||||
|
if ! echo "$auth_status" | grep -q "read:project"; then
|
||||||
|
missing_scopes="$missing_scopes read:project project"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -n "$missing_scopes" ]]; then
|
||||||
|
warn "GitHub CLI missing scopes:$missing_scopes"
|
||||||
|
echo "Run: gh auth refresh -h github.com -s workflow,read:project,project"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue