You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Checks token scopes using x-oauth-scopes header:
- Reports scopes for classic PATs
- Warns if repo/public_repo scope missing
- Provides guidance for fine-grained PATs
Based on https://github.com/orgs/community/discussions/25259
Write-Output "::warning::Token has no scopes. If using a fine-grained PAT, ensure it has Contents (write) and Pull Requests (write) permissions."
154
+
} else {
155
+
Write-Output "Token scopes: $scopes"
156
+
if ($scopes -notmatch '\brepo\b' -and $scopes -notmatch '\bpublic_repo\b') {
157
+
Write-Output "::warning::Token may be missing 'repo' or 'public_repo' scope. This may cause issues with private repositories."
158
+
}
159
+
}
160
+
} else {
161
+
Write-Output "::notice::Could not detect token scopes (this is normal for fine-grained PATs). Ensure token has Contents (write) and Pull Requests (write) permissions."
162
+
}
163
+
145
164
Write-Output "✓ GitHub token is valid and has access to this repository"
0 commit comments