Skip to content
This repository has been archived by the owner on Dec 10, 2024. It is now read-only.

Commit

Permalink
Merge pull request #2035 from seyguai/protected_branches-deploy_key_id
Browse files Browse the repository at this point in the history
missing protected_branches#deploy_key_id
  • Loading branch information
svanharmelen authored Oct 14, 2024
2 parents f1dc012 + cda2986 commit da5d7f1
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 da5d7f1

Please sign in to comment.