Script to rollup Dependabot pull requests on GitHub
This file contains 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 | |
if [ $# -ne 2 ] ; then | |
echo "Usage rollup.sh <BASE_PR> <LAST_PR>" | |
exit 1 | |
fi | |
BASE_PR=$1 | |
LAST_PR=$2 | |
git pull | |
gh pr checkout "$BASE_PR" | |
for (( i=(($BASE_PR + 1)); i<=$LAST_PR; i++ )) | |
do | |
PR_BRANCH=$(gh pr view "$i" --json headRefName -q .headRefName) | |
git merge origin/"$PR_BRANCH" -m "build(deps): Merge branch for #{$i} {$PR_BRANCH}" | |
done | |
git push |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment