-
-
Save cpswan/1e61f12b4a83355a7560d96cb1cdf726 to your computer and use it in GitHub Desktop.
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): Rollup 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