Created
September 30, 2021 17:15
-
-
Save halaxa/e8153b36915b1c558dc750ab9d04c0f0 to your computer and use it in GitHub Desktop.
Convert github issue to pull request via an API call
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
TOKEN= # Create github token here https://github.com/settings/tokens and check `repo` scope | |
USERNAME= # github user name | |
ISSUE_ID= # issue id without '#' | |
PR_HEAD= # usually your feature branch | |
PR_BASE= # usually `master` | |
REPO= # repository name | |
curl --user "$USERNAME:$TOKEN" \ | |
--header "Accept: application/vnd.github.v3+json" \ | |
--request POST \ | |
--data "{\"issue\": $ISSUE_ID, \"head\": \"$PR_HEAD\", \"base\": \"$PR_BASE\"}" \ | |
"https://api.github.com/repos/$USERNAME/$REPO/pulls" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment