Remove GHE handling for workflow scope (#7841)

According to [0] we appear to no longer support GHE 2.x, as the latest
release was deprecated in early 2022.

We can therefore remove this custom handling.

[0]: https://docs.github.com/en/enterprise-server@3.7/admin/all-releases
This commit is contained in:
Jamie Tanna 2023-08-15 18:40:09 +01:00 committed by GitHub
parent c5eb188698
commit e4cddb562e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 24 deletions

View file

@ -117,8 +117,7 @@ func TestLogin_ssh(t *testing.T) {
func Test_scopesSentence(t *testing.T) {
type args struct {
scopes []string
isEnterprise bool
scopes []string
}
tests := []struct {
name string
@ -128,39 +127,28 @@ func Test_scopesSentence(t *testing.T) {
{
name: "basic scopes",
args: args{
scopes: []string{"repo", "read:org"},
isEnterprise: false,
scopes: []string{"repo", "read:org"},
},
want: "'repo', 'read:org'",
},
{
name: "empty",
args: args{
scopes: []string(nil),
isEnterprise: false,
scopes: []string(nil),
},
want: "",
},
{
name: "workflow scope for dotcom",
name: "workflow scope",
args: args{
scopes: []string{"repo", "workflow"},
isEnterprise: false,
scopes: []string{"repo", "workflow"},
},
want: "'repo', 'workflow'",
},
{
name: "workflow scope for GHE",
args: args{
scopes: []string{"repo", "workflow"},
isEnterprise: true,
},
want: "'repo', 'workflow' (GHE 3.0+)",
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := scopesSentence(tt.args.scopes, tt.args.isEnterprise); got != tt.want {
if got := scopesSentence(tt.args.scopes); got != tt.want {
t.Errorf("scopesSentence() = %q, want %q", got, tt.want)
}
})