We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 626be2a commit 53cea26Copy full SHA for 53cea26
api/client.go
@@ -196,6 +196,11 @@ func (c Client) HasMinimumScopes(hostname string) error {
196
}
197
198
scopesHeader := res.Header.Get("X-Oauth-Scopes")
199
+ if scopesHeader == "" {
200
+ // if the token reports no scopes, assume that it's an integration token and give up on
201
+ // detecting its capabilities
202
+ return nil
203
+ }
204
205
search := map[string]bool{
206
"repo": false,
api/client_test.go
@@ -111,6 +111,11 @@ func Test_HasMinimumScopes(t *testing.T) {
111
header string
112
wantErr string
113
}{
114
+ {
115
+ name: "no scopes",
116
+ header: "",
117
+ wantErr: "",
118
+ },
119
{
120
name: "default scopes",
121
header: "repo, read:org",
0 commit comments