Created
November 18, 2020 11:00
-
-
Save gries/41358014755ee28323c49deb03fd6988 to your computer and use it in GitHub Desktop.
A simple bash script to move all open PRs from master to main
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 | |
# get all open PR numbers that have master as base | |
PRS=`gh pr list --state open --base master | cat | cut -f 1` | |
for PR_ID in $PRS; do | |
echo "PR: $PR_ID" | |
# Migrate pull-request to main branch | |
gh api -F base='main' -X PATCH /repos/gries/api-platform/pulls/$PR_ID > /dev/null | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment