Last active
July 15, 2020 07:57
-
-
Save dennisoelkers/86296ddcf67fc962902c273e03e8ed65 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Polling the status checks for a PR and merges it when they are green. | |
# Needs to be executed in the directory of the PR's repo. | |
# | |
# Args: merge-on-green <PR> | |
# where PR is the number of the PR without "#" | |
# | |
PR_NO=$1 | |
while true; do | |
HEAD_COMMIT=`hub pr show -f "%sH" $PR_NO` | |
hub ci-status ${HEAD_COMMIT} > /dev/null && hub api -F merge_method=squash -X PUT repos/{owner}/{repo}/pulls/${PR_NO}/merge && exit 0 | |
sleep 30 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment