Created
June 16, 2014 14:26
-
-
Save AntonTyutin/483f6148592f78f7fcdb to your computer and use it in GitHub Desktop.
Attach GitHub pull-request to an existent issue
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 | |
API_TOKEN="~" | |
NL=" | |
" | |
NL2="$NL$NL" | |
HELP="$NL2 Usage: $0 vendor/repo feature_branch 15$NL" | |
REPO=${1:?"$NL2 A repository name (vendor/repo) must be specified.$HELP"} | |
HEAD=${2:?"$NL2 A branch name must be specified.$HELP"} | |
ISSUE=${3:?"$NL2 An issue id must be specified.$HELP"} | |
BASE=${4:-'master'} | |
curl \ | |
-H "Authorization: token $API_TOKEN" \ | |
--request POST \ | |
--data "{\"issue\": \"$ISSUE\", \"head\": \"$HEAD\", \"base\": \"$BASE\"}" \ | |
"https://api.github.com/repos/$REPO/pulls" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment