-
-
Save KyMidd/fbac58b4ae3c6185c04f130e035affbb 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
| # If there are no changes, the PR will not be created | |
| # Note that even modified files will show up as 'add' in the git add output | |
| if [[ $(echo "$git_add" | grep -E 'add|remove') ]]; then | |
| # Changes were made, checkout a branch and make a PR | |
| git checkout -b "$branch_name" | |
| git commit -m "$commit_message" | |
| git push origin "$branch_name" | |
| created_pr_url=$(gh pr create -b "$pr_body" -t "$pr_title" -B "$base_branch" --fill) | |
| # If auto_merge_pr is true, merge the PR | |
| if [ "$auto_merge_pr" = true ]; then | |
| gh pr merge --admin -d -m "$created_pr_url" | |
| else | |
| echo "PR created, please merge: $created_pr_url" | |
| fi | |
| # Sleep 2 seconds to avoid rate limiting | |
| sleep 2 | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment