Created
July 19, 2014 10:16
-
-
Save Jc2k/f5dce6d0e460e6295ef7 to your computer and use it in GitHub Desktop.
Crappy API invocation to turn a ticket into a pull request (in python)
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
import requests | |
import json | |
issue = 104 | |
branch = "BRANCH_TO_MERGE" | |
username = "USERNAME" | |
repo = "REPO" | |
url = "https://api.github.com/repos/%(username)s/%(repo)s/pulls" % locals() | |
headers = {"Authorization": "token SOMETOKEN"} | |
requests.post(url, headers=headers, data=json.dumps({ | |
"issue": str(issue), | |
"head": "%s:%s" % (username, branch), | |
"base": "master", | |
})) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment