Skip to content

Commit b0e359d

Browse files
authored
github token name import fix (#3335)
1 parent bcd98a6 commit b0e359d

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

.env.example

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,5 @@ SLACK_SIGNING_SECRET=your_slack_signing_secret_here
3636
BLUESKY_USERNAME=example.bsky.social
3737
BLUESKY_PASSWORD='example#123'
3838

39-
GITHUB_ACCESS_TOKEN="abc123"
39+
GITHUB_TOKEN="abc123"
4040
ORD_SERVER_URL="http://ipv4:port"

scripts/get_daily_commits_for_user.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
username = "USERNAME" # GitHub username of the user
88
repo = "REPOSITORY" # Repository name
99
owner = "OWNER" # Owner of the repository, can be a user or an organization
10-
token = "YOUR_GITHUB_ACCESS_TOKEN" # Personal Access Token (PAT) for authentication
10+
token = "YOUR_GITHUB_TOKEN" # Personal Access Token (PAT) for authentication
1111
start_date = "2023-01-01" # Start date in YYYY-MM-DD format
1212
end_date = "2023-01-31" # End date in YYYY-MM-DD format
1313
csv_filename = "commit_data.csv"

website/utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from .models import PRAnalysisReport
2020

2121
# openai.api_key = os.getenv("OPENAI_API_KEY")
22-
GITHUB_API_TOKEN = os.getenv("GITHUB_ACCESS_TOKEN")
22+
GITHUB_API_TOKEN = os.getenv("GITHUB_TOKEN")
2323

2424
WHITELISTED_IMAGE_TYPES = {
2525
"jpeg": "image/jpeg",

website/views/issue.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ def vote_count(request, issue_pk):
152152
def create_github_issue(request, id):
153153
issue = get_object_or_404(Issue, id=id)
154154
screenshot_all = IssueScreenshot.objects.filter(issue=issue)
155-
if not os.environ.get("GITHUB_ACCESS_TOKEN"):
155+
if not os.environ.get("GITHUB_TOKEN"):
156156
return JsonResponse({"status": "Failed", "status_reason": "GitHub Access Token is missing"})
157157
if issue.github_url:
158158
return JsonResponse(
@@ -184,7 +184,7 @@ def create_github_issue(request, id):
184184
response = requests.post(
185185
url,
186186
data=json.dumps(issue_data),
187-
headers={"Authorization": f"token {os.environ.get('GITHUB_ACCESS_TOKEN')}"},
187+
headers={"Authorization": f"token {os.environ.get('GITHUB_TOKEN')}"},
188188
)
189189
if response.status_code == 201:
190190
response_data = response.json()
@@ -1008,7 +1008,7 @@ def create_issue(self, form):
10081008

10091009
redirect_url = "/report"
10101010

1011-
if domain.github and os.environ.get("GITHUB_ACCESS_TOKEN"):
1011+
if domain.github and os.environ.get("GITHUB_TOKEN"):
10121012
import json
10131013

10141014
import requests
@@ -1041,7 +1041,7 @@ def create_issue(self, form):
10411041
r = requests.post(
10421042
url,
10431043
json.dumps(issue),
1044-
headers={"Authorization": "token " + os.environ.get("GITHUB_ACCESS_TOKEN")},
1044+
headers={"Authorization": "token " + os.environ.get("GITHUB_TOKEN")},
10451045
)
10461046
response = r.json()
10471047
try:

website/views/user.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1052,7 +1052,7 @@ def assign_github_badge(user, action_title):
10521052
# if not signature:
10531053
# return False
10541054

1055-
# secret = bytes(os.environ.get("GITHUB_ACCESS_TOKEN", ""), "utf-8")
1055+
# secret = bytes(os.environ.get("GITHUB_TOKEN", ""), "utf-8")
10561056
# computed_hmac = hmac.new(secret, payload, hashlib.sha256)
10571057
# computed_signature = f"sha256={computed_hmac.hexdigest()}"
10581058

0 commit comments

Comments
 (0)