简体   繁体   中英

Restrict push action without pull request

Is there any way to make IAM policy where user should not be allowed to push the code to the branch directly? They should only do it through pull request.

Yes, it is possible to ensure the only way of modifying your branches is through a PullRequest. You can achieve this by either removing the following permissions from your policy or adding an explicit Deny, in case you are using a AWS managed policy:

codecommit:MergeBranchesByFastForward
codecommit:MergeBranchesBySquash
codecommit:MergeBranchesByThreeWay

And making sure you have the permissions to merge a PullRequest:

codecommit:MergePullRequestByFastForward
codecommit:MergePullRequestBySquash
codecommit:MergePullRequestByThreeWay

Here the docs with the permissions for CodeCommit: https://docs.aws.amazon.com/codecommit/latest/userguide/auth-and-access-control-permissions-reference.html#aa-pr

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM