Skip to content

Instantly share code, notes, and snippets.

@cpswan

cpswan/rollup.sh Secret

Created March 9, 2023 09:38
Embed
What would you like to do?
Script to rollup Dependabot pull requests on GitHub
#!/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