From cda298626d7fa863b37236f3ec8ccb6b1aa05db7 Mon Sep 17 00:00:00 2001 From: seyguai Date: Mon, 14 Oct 2024 09:20:07 +0200 Subject: [PATCH] missing protected_branches#deploy_key_id --- protected_branches.go | 1 + protected_branches_test.go | 35 +++++++++++++++++++++++++++++++++-- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/protected_branches.go b/protected_branches.go index d13f57a60..7fd83bee0 100644 --- a/protected_branches.go +++ b/protected_branches.go @@ -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() diff --git a/protected_branches_test.go b/protected_branches_test.go index 0aaecbeea..7a22f03a2 100644 --- a/protected_branches_test.go +++ b/protected_branches_test.go @@ -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 } @@ -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{ {