-
-
Save KyMidd/080d466257b7e2b094ed4b816de0bc10 to your computer and use it in GitHub Desktop.
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
# Attempt push, open PR | |
gitPushResults= | |
gitPushResults=$(git push origin $branch --force 2>&1 || true) | |
# Check if failed to push due to archived read-only | |
if echo "$gitPushResults" | grep -q "This repository was archived"; then | |
echo "This repository is archived, and is read-only, skipping" | |
# Cleanup | |
cd ../ | |
rm -rf $repo | |
# Continue to next loop | |
continue | |
elif echo "$gitPushResults" | grep -q "already exists"; then | |
echo "Pull request already exists with this name, skipping" | |
# Cleanup | |
cd ../ | |
rm -rf $repo | |
# Continue to next loop | |
continue |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment