Last active
June 28, 2021 05:24
-
-
Save rg3915/15f76bf57d6ca2eddf0ceda051275bbd to your computer and use it in GitHub Desktop.
A simple Python script that can create an issue on a specific repository. github cli github issues
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
""" | |
requires the "PyGitHub" package (`pip install pygithub`). | |
You can leave out things like an assignee, a label etc., by simply leaving them out of the code. | |
""" | |
from github import Github | |
import os | |
from pprint import pprint | |
token = "INSERT YOUR PERSONAL-ACCESS-TOKEN HERE" | |
client = Github(token) | |
repo = client.get_repo("USERNAME/REPONAME") | |
issue = repo.create_issue( | |
title="TITLE OF THE ISSUE", | |
body="TTEXT OF THE ISSUE", | |
assignee="SOMEONE", | |
labels=[ | |
repo.get_label("SOME LABEL") | |
] | |
) | |
pprint(issue) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment