Created
August 8, 2013 15:30
-
-
Save florinel-chis/6185656 to your computer and use it in GitHub Desktop.
Shell script to retrieve the patch file for a pull request in a private repo on github
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 | |
usage() | |
{ | |
cat << EOF | |
usage: $0 pull_id | |
pull_id needs to be a number | |
EOF | |
} | |
if [ -z "$1" ] | |
then | |
usage | |
exit 1 | |
fi | |
PULL_ID=$1 | |
cwd=$(pwd) | |
TOKEN="YOUR_TOKEN_HERE" | |
curl -H "Authorization: token $TOKEN" -H "Accept: application/vnd.github.v3.patch" https://api.github.com/repos/user/repo/pulls/$PULL_ID > $cwd/patches/$PULL_ID.patch |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment