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

missing protected_branches#deploy_key_id #2035

Merged
merged 1 commit into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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