Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions dojo/github.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from django.template.loader import render_to_string

# External libs
from github import Github
from github import Auth, Github

# Dojo related imports
from dojo.models import Engagement, GITHUB_Issue, GITHUB_PKey, Product
Expand Down Expand Up @@ -33,7 +33,7 @@ def reopen_external_issue_github(find, note, prod, eng):
g_issue = GITHUB_Issue.objects.get(finding=find)

try:
g_ctx = Github(github_conf.api_key)
g_ctx = Github(auth=Auth.Token(github_conf.api_key))
repo = g_ctx.get_repo(github_product.git_project)
issue = repo.get_issue(int(g_issue.issue_id))
except:
Expand Down Expand Up @@ -64,7 +64,7 @@ def close_external_issue_github(find, note, prod, eng):
g_issue = GITHUB_Issue.objects.get(finding=find)

try:
g_ctx = Github(github_conf.api_key)
g_ctx = Github(auth=Auth.Token(github_conf.api_key))
repo = g_ctx.get_repo(github_product.git_project)
issue = repo.get_issue(int(g_issue.issue_id))
except:
Expand Down Expand Up @@ -95,7 +95,7 @@ def update_external_issue_github(find, prod, eng):
g_issue = GITHUB_Issue.objects.get(finding=find)

try:
g_ctx = Github(github_conf.api_key)
g_ctx = Github(auth=Auth.Token(github_conf.api_key))
repo = g_ctx.get_repo(github_product.git_project)
issue = repo.get_issue(int(g_issue.issue_id))
issue.edit(title=find.title, body=github_body(find), labels=["defectdojo", "security / " + find.severity])
Expand Down Expand Up @@ -130,7 +130,7 @@ def add_external_issue_github(find, prod, eng):
logger.info("Create issue with github profile: " + str(github_conf) + " on product: " + str(github_product_key))

try:
g = Github(github_conf.api_key)
g = Github(auth=Auth.Token(github_conf.api_key))
user = g.get_user()
logger.debug("logged in with github user: " + user.login)
logger.debug("Look for project: " + github_product_key.git_project)
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ djangorestframework==3.16.0
html2text==2025.4.15
humanize==4.12.3
jira==3.8.0
PyGithub==1.58.2
PyGithub==2.6.1
lxml==6.0.0
Markdown==3.8.2
openpyxl==3.1.5
Expand Down