Recognize the write:org OAuth scope as satisfying read:org
If someone pastes a PAT with `write:org` scope, this avoids the error complaining that the token doesn't have `read:org` permissions. On GitHub, `write:org` implies `read:org`.
This commit is contained in:
parent
4e5aa91fac
commit
0be2033d51
2 changed files with 6 additions and 1 deletions
|
|
@ -216,7 +216,7 @@ func (c Client) HasMinimumScopes(hostname string) error {
|
|||
missingScopes = append(missingScopes, "repo")
|
||||
}
|
||||
|
||||
if !search["read:org"] && !search["admin:org"] {
|
||||
if !search["read:org"] && !search["write:org"] && !search["admin:org"] {
|
||||
missingScopes = append(missingScopes, "read:org")
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -131,6 +131,11 @@ func Test_HasMinimumScopes(t *testing.T) {
|
|||
header: "repo, admin:org",
|
||||
wantErr: "",
|
||||
},
|
||||
{
|
||||
name: "write:org satisfies read:org",
|
||||
header: "repo, write:org",
|
||||
wantErr: "",
|
||||
},
|
||||
{
|
||||
name: "insufficient scope",
|
||||
header: "repo",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue