Skip to content

Commit

Permalink
missing protected_branches#deploy_key_id
Browse files Browse the repository at this point in the history
  • Loading branch information
seyguai committed Oct 14, 2024
1 parent b5e0812 commit cda2986
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 2 deletions.
1 change: 1 addition & 0 deletions protected_branches.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ type BranchAccessDescription struct {
AccessLevelDescription string `json:"access_level_description"`
UserID int `json:"user_id"`
GroupID int `json:"group_id"`
DeployKeyID int `json:"deploy_key_id"`
}

// ListProtectedBranchesOptions represents the available ListProtectedBranches()
Expand Down
35 changes: 33 additions & 2 deletions protected_branches_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,31 @@ func TestListProtectedBranches(t *testing.T) {
"push_access_levels":[{
"id":1,
"access_level":40,
"access_level_description":"Maintainers"
"access_level_description":"Maintainers",
"deploy_key_id":null,
"user_id":null,
"group_id":null
},{
"id":2,
"access_level":30,
"access_level_description":"User name",
"deploy_key_id":null,
"user_id":123,
"group_id":null
},{
"id":3,
"access_level":40,
"access_level_description":"deploy key",
"deploy_key_id":456,
"user_id":null,
"group_id":null
}],
"merge_access_levels":[{
"id":1,
"access_level":40,
"access_level_description":"Maintainers"
"access_level_description":"Maintainers",
"user_id":null,
"group_id":null
}],
"code_owner_approval_required":false
}
Expand All @@ -61,6 +80,18 @@ func TestListProtectedBranches(t *testing.T) {
AccessLevel: 40,
AccessLevelDescription: "Maintainers",
},
{
ID: 2,
AccessLevel: 30,
AccessLevelDescription: "User name",
UserID: 123,
},
{
ID: 3,
AccessLevel: 40,
AccessLevelDescription: "deploy key",
DeployKeyID: 456,
},
},
MergeAccessLevels: []*BranchAccessDescription{
{
Expand Down

0 comments on commit cda2986

Please sign in to comment.