Skip to content

Commit 44aedce

Browse files
authored
Use new auth (#214)
# Exercise Review ## Exercise Discussion Link the exercise discussion issue ## Checklist - [ ] If you require a new remote repository on the `Git-Mastery` organization, have you [created a request](https://github.com/git-mastery/exercises/issues/new?template=request_exercise_repository.md) for it? - [ ] Have you written unit tests using [`repo-smith`](https://github.com/git-mastery/repo-smith) to validate the exercise grading scheme? - [ ] Have you tested your changes using the instructions posted? - [ ] Have you verified that this exercise does not already exist or is not currently in review? - [ ] Did you introduce a new grading mechanism that should belong to [`git-autograder`](https://github.com/git-mastery/git-autograder)? - [ ] Did you introduce a new dependency that should belong to [`app`](https://github.com/git-mastery/app)?
1 parent 9d98bcb commit 44aedce

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

scripts/post-contribution-message.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import os
22

3-
from github import Github
3+
from github import Github, Auth
44

55
GITHUB_TOKEN = os.environ.get("GITHUB_TOKEN")
66
PR_NUMBER = os.environ.get("PR_NUMBER")
@@ -17,7 +17,10 @@
1717
assert PR_NUMBER is not None
1818
PR_NUMBER_INT = int(PR_NUMBER)
1919

20-
gh = Github(GITHUB_TOKEN)
20+
assert GITHUB_TOKEN is not None
21+
22+
auth = Auth.Token(GITHUB_TOKEN)
23+
gh = Github(auth=auth)
2124
repo = gh.get_repo("git-mastery/exercises")
2225
pr = repo.get_pull(PR_NUMBER_INT)
2326

0 commit comments

Comments
 (0)