-
-
Save ichadhr/085bf637af9f4f334cd8 to your computer and use it in GitHub Desktop.
Attaching a pull request to an existing GitHub issue
This file contains hidden or 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
#!/usr/bin/env bash | |
read -p "GitHub username: " -ei $(git config --get github.user) USERNAME | |
read -sp "GitHub password: " PASSWORD | |
echo | |
read -p "Submit pull request to user: " TO_USER | |
read -p "Submit pull request to repository: " TO_REPO | |
read -p "Submit pull request to branch: " -ei master TO_BRANCH | |
read -p "Submit pull request from user: " -ei $USERNAME FROM_USER | |
read -p "Submit pull request from branch: " FROM_BRANCH | |
read -p "Issue number to attach pull request to: " ISSUE | |
read -p "Submit pull request? (y/n) " | |
if [[ $REPLY =~ ^[Yy] ]]; then | |
curl -X POST -u "$USERNAME:$PASSWORD" "https://api.github.com/repos/$TO_USER/$TO_REPO/pulls" \ | |
-d "{\"issue\":\"$ISSUE\",\"head\":\"$FROM_USER:$FROM_BRANCH\",\"base\":\"$TO_BRANCH\"}"; | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment