IsGitHubAppOnlyScope returns true if the scope is a GitHub App-only permission (not supported by GITHUB_TOKEN). These scopes require a GitHub App to exercise.
(scope PermissionScope)
| 194 | // IsGitHubAppOnlyScope returns true if the scope is a GitHub App-only permission |
| 195 | // (not supported by GITHUB_TOKEN). These scopes require a GitHub App to exercise. |
| 196 | func IsGitHubAppOnlyScope(scope PermissionScope) bool { |
| 197 | isAppOnly := slices.Contains(GetAllGitHubAppOnlyScopes(), scope) |
| 198 | if isAppOnly { |
| 199 | permissionsLog.Printf("Scope %q requires GitHub App (not supported by GITHUB_TOKEN)", scope) |
| 200 | } |
| 201 | return isAppOnly |
| 202 | } |
| 203 | |
| 204 | // Permissions represents GitHub Actions permissions |
| 205 | // It can be a shorthand (read-all, write-all, read, write, none) or a map of scopes to levels |