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

Commit cda2986

Browse files
committed
missing protected_branches#deploy_key_id
1 parent b5e0812 commit cda2986

File tree

2 files changed

+34
-2
lines changed

2 files changed

+34
-2
lines changed

Diff for: protected_branches.go

+1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ type BranchAccessDescription struct {
5656
AccessLevelDescription string `json:"access_level_description"`
5757
UserID int `json:"user_id"`
5858
GroupID int `json:"group_id"`
59+
DeployKeyID int `json:"deploy_key_id"`
5960
}
6061

6162
// ListProtectedBranchesOptions represents the available ListProtectedBranches()

Diff for: protected_branches_test.go

+33-2
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,31 @@ func TestListProtectedBranches(t *testing.T) {
3535
"push_access_levels":[{
3636
"id":1,
3737
"access_level":40,
38-
"access_level_description":"Maintainers"
38+
"access_level_description":"Maintainers",
39+
"deploy_key_id":null,
40+
"user_id":null,
41+
"group_id":null
42+
},{
43+
"id":2,
44+
"access_level":30,
45+
"access_level_description":"User name",
46+
"deploy_key_id":null,
47+
"user_id":123,
48+
"group_id":null
49+
},{
50+
"id":3,
51+
"access_level":40,
52+
"access_level_description":"deploy key",
53+
"deploy_key_id":456,
54+
"user_id":null,
55+
"group_id":null
3956
}],
4057
"merge_access_levels":[{
4158
"id":1,
4259
"access_level":40,
43-
"access_level_description":"Maintainers"
60+
"access_level_description":"Maintainers",
61+
"user_id":null,
62+
"group_id":null
4463
}],
4564
"code_owner_approval_required":false
4665
}
@@ -61,6 +80,18 @@ func TestListProtectedBranches(t *testing.T) {
6180
AccessLevel: 40,
6281
AccessLevelDescription: "Maintainers",
6382
},
83+
{
84+
ID: 2,
85+
AccessLevel: 30,
86+
AccessLevelDescription: "User name",
87+
UserID: 123,
88+
},
89+
{
90+
ID: 3,
91+
AccessLevel: 40,
92+
AccessLevelDescription: "deploy key",
93+
DeployKeyID: 456,
94+
},
6495
},
6596
MergeAccessLevels: []*BranchAccessDescription{
6697
{

0 commit comments

Comments
 (0)