Last active
November 21, 2024 09:40
-
-
Save alexdewar/ace763f65a790e14f6d35239a8db1b58 to your computer and use it in GitHub Desktop.
A script to merge all PRs from bots
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/bash | |
set -euo pipefail | |
for bot in pre-commit-ci dependabot; do | |
for pr in $(gh pr list --author ${bot}[bot]|awk '{print $1}'); do | |
# Depending on branch protection rules, an approving review may be required | |
gh pr review --approve "$pr" | |
# Merge via rebase if and when checks complete successfully | |
gh pr merge -r --auto "$pr" | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment