Skip to content

Instantly share code, notes, and snippets.

@kvbik
Created May 5, 2015 20:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kvbik/c6d090590a229c9184e3 to your computer and use it in GitHub Desktop.
Save kvbik/c6d090590a229c9184e3 to your computer and use it in GitHub Desktop.
quick and hacky shell script for transforming github issue to a pull request
#!/bin/bash
# all credits and thx to http://stackoverflow.com/a/4529172
[[ $1 ]] && ISSUE=$1 || exit
[[ $2 ]] && BRANCH=$2 || exit
[[ $3 ]] && BASE=$3 || BASE=master
OWNER=walksource
REPO=roomstorm-backend
REQUESTER=walksource
USER=kvbik
data="{'issue': '$ISSUE', 'head': '$REQUESTER:$BRANCH', 'base': '$BASE'}"
data=$( echo $data | sed "s/'/\"/g" )
curl --user "$USER" --request POST --data "$data" https://api.github.com/repos/$OWNER/$REPO/pulls
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment