Skip to content

Commit

Permalink
create_github_issue
Browse files Browse the repository at this point in the history
  • Loading branch information
BigOleHealz committed Oct 23, 2024
1 parent eed6c58 commit ff54755
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions services/github/github_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,6 @@
request_limit_reached,
)

@handle_exceptions(default_return_value=None, raise_on_error=False)
def create_github_issue(title: str, description: str) -> Issue:
"""Create a GitHub issue and return the issue URL."""
github: Github = Github(GITHUB_PERSONAL_ACCESS_TOKEN)
repo: Repository = github.get_repo(f"{GITHUB_TEST_REPO_OWNER}/{GITHUB_TEST_REPO_NAME}")
issue: Issue = repo.create_issue(title=title, body=description)
issue.add_to_labels(PRODUCT_ID) # Add label to trigger GitAuto

print(f"Github issue created: {issue.html_url}")
return issue

@handle_exceptions(default_return_value=None, raise_on_error=False)
def add_issue_templates(full_name: str, installer_name: str, token: str) -> None:
print(f"Adding issue templates to the repo: '{full_name}' by '{installer_name}'.\n")
Expand Down Expand Up @@ -843,3 +832,15 @@ def update_comment_for_raised_errors(
update_comment(comment_url=comment_url, token=token, body=body)

raise RuntimeError("Error occurred")


@handle_exceptions(default_return_value=None, raise_on_error=False)
def (title: str, description: str) -> Issue:
"""Create a GitHub issue and return the issue URL."""
github: Github = Github(GITHUB_PERSONAL_ACCESS_TOKEN)
repo: Repository = github.get_repo(f"{GITHUB_TEST_REPO_OWNER}/{GITHUB_TEST_REPO_NAME}")
issue: Issue = repo.create_issue(title=title, body=description)
issue.add_to_labels(PRODUCT_ID) # Add label to trigger GitAuto

print(f"Github issue created: {issue.html_url}")
return issue

0 comments on commit ff54755

Please sign in to comment.