Run GitHub Actions for specific number of approvals #26878
-
Hello everyone! I want to run a step in a job for a specific number of approvals on a PR. (please check the comment in below mentioned code) Here is my workflow yaml:
Can anyone help me to generate this specific condition. Q.2 And it will merge for the event Thanks ! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
According to the introduction from the README of the action “pascalgn/automerge-action”, the action will automatically check if the required number of review approvals has been reached. If the number is not reached, it will not merge the PR. In addition, the event you set for the workflow is not the right. You should set the events that are related to pull request, such as “pull_request”, “pull_request_review”, “pull_request_review_comment” or “pull_request_target”. About the second question, you can try to set the “Branch protection rules” for target branch of the PR. |
Beta Was this translation helpful? Give feedback.
-
Awesome thanks @brightran |
Beta Was this translation helpful? Give feedback.
-
You’re welcome, @uditgaurav. |
Beta Was this translation helpful? Give feedback.
@uditgaurav ,
According to the introduction from the README of the action “pascalgn/automerge-action”, the action will automatically check if the required number of review approvals has been reached. If the number is not reached, it will not merge the PR.
In addition, the event you set for the workflow is not the right. You should set the events that are related to pull request, such as “pull_request”, “pull_request_review”, “pull_request_review_comment” or “pull_request_target”.
In your case, the “pull_request_review” event should be the suitable.
About the second question, you can try to set the “Branch protection rules” for target branch of the PR.