diff options
author | a1012112796 <1012112796@qq.com> | 2020-11-29 03:30:46 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-28 21:30:46 +0200 |
commit | 9c26dc1f3a742280baff4e9578545bc822016764 (patch) | |
tree | ac997d23e59a658b387302ecd65e76a39d99b9e8 /modules/convert | |
parent | 7ed5bf8cbe06bf2cfc4980cf6e020dc46dd71a79 (diff) | |
download | gitea-9c26dc1f3a742280baff4e9578545bc822016764.tar.gz gitea-9c26dc1f3a742280baff4e9578545bc822016764.zip |
Add block on official review requests branch protection (#13705)
Signed-off-by: a1012112796 <1012112796@qq.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
Diffstat (limited to 'modules/convert')
-rw-r--r-- | modules/convert/convert.go | 45 |
1 files changed, 23 insertions, 22 deletions
diff --git a/modules/convert/convert.go b/modules/convert/convert.go index 5d056c3795..9b20c683be 100644 --- a/modules/convert/convert.go +++ b/modules/convert/convert.go @@ -105,28 +105,29 @@ func ToBranchProtection(bp *models.ProtectedBranch) *api.BranchProtection { } return &api.BranchProtection{ - BranchName: bp.BranchName, - EnablePush: bp.CanPush, - EnablePushWhitelist: bp.EnableWhitelist, - PushWhitelistUsernames: pushWhitelistUsernames, - PushWhitelistTeams: pushWhitelistTeams, - PushWhitelistDeployKeys: bp.WhitelistDeployKeys, - EnableMergeWhitelist: bp.EnableMergeWhitelist, - MergeWhitelistUsernames: mergeWhitelistUsernames, - MergeWhitelistTeams: mergeWhitelistTeams, - EnableStatusCheck: bp.EnableStatusCheck, - StatusCheckContexts: bp.StatusCheckContexts, - RequiredApprovals: bp.RequiredApprovals, - EnableApprovalsWhitelist: bp.EnableApprovalsWhitelist, - ApprovalsWhitelistUsernames: approvalsWhitelistUsernames, - ApprovalsWhitelistTeams: approvalsWhitelistTeams, - BlockOnRejectedReviews: bp.BlockOnRejectedReviews, - BlockOnOutdatedBranch: bp.BlockOnOutdatedBranch, - DismissStaleApprovals: bp.DismissStaleApprovals, - RequireSignedCommits: bp.RequireSignedCommits, - ProtectedFilePatterns: bp.ProtectedFilePatterns, - Created: bp.CreatedUnix.AsTime(), - Updated: bp.UpdatedUnix.AsTime(), + BranchName: bp.BranchName, + EnablePush: bp.CanPush, + EnablePushWhitelist: bp.EnableWhitelist, + PushWhitelistUsernames: pushWhitelistUsernames, + PushWhitelistTeams: pushWhitelistTeams, + PushWhitelistDeployKeys: bp.WhitelistDeployKeys, + EnableMergeWhitelist: bp.EnableMergeWhitelist, + MergeWhitelistUsernames: mergeWhitelistUsernames, + MergeWhitelistTeams: mergeWhitelistTeams, + EnableStatusCheck: bp.EnableStatusCheck, + StatusCheckContexts: bp.StatusCheckContexts, + RequiredApprovals: bp.RequiredApprovals, + EnableApprovalsWhitelist: bp.EnableApprovalsWhitelist, + ApprovalsWhitelistUsernames: approvalsWhitelistUsernames, + ApprovalsWhitelistTeams: approvalsWhitelistTeams, + BlockOnRejectedReviews: bp.BlockOnRejectedReviews, + BlockOnOfficialReviewRequests: bp.BlockOnOfficialReviewRequests, + BlockOnOutdatedBranch: bp.BlockOnOutdatedBranch, + DismissStaleApprovals: bp.DismissStaleApprovals, + RequireSignedCommits: bp.RequireSignedCommits, + ProtectedFilePatterns: bp.ProtectedFilePatterns, + Created: bp.CreatedUnix.AsTime(), + Updated: bp.UpdatedUnix.AsTime(), } } |