Last active
February 17, 2016 18:03
-
-
Save tbrittoborges/524093cccf42d62b5fbc to your computer and use it in GitHub Desktop.
automatically sends a github 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
import requests | |
data = {"title": "Found a bug", # str | |
"body": "I'm having a problem with this.", # str | |
"assignee": None, # username str or None | |
"milestone": 1, # int | |
"labels": ['label1']} # list of str | |
def submit_github_issue(data, token, username, repo): | |
headers = {'Content-Type':'application/json', | |
'Authorization': 'token {}'.format(token)} | |
url = "https://api.github.com/repos/{}/{}/issues".format | |
r = requests.post(url(username, repo), | |
headers=headers, | |
json=data) | |
r.raise_for_status() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment