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:
parent
c5eb188698
commit
e4cddb562e
2 changed files with 8 additions and 24 deletions
|
|
@ -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)
|
||||
}
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue