Skip to content

Commit 4b588d1

Browse files
committed
feat: add GITHUB_TOKEN
1 parent be702af commit 4b588d1

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

.github/workflows/commit-check.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ jobs:
1111
steps:
1212
- uses: actions/checkout@v4
1313
- uses: ./ # self test
14+
env:
15+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # used by `pr-comments`
1416
with:
1517
message: true
1618
branch: true

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
venv/
2+
.venv/

main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def add_pr_comments() -> int:
106106
# Initialize GitHub client
107107
g = Github(token)
108108
repo = g.get_repo(repo_name)
109-
issue = repo.get_issue(int(pr_number))
109+
pr = repo.get_issue(int(pr_number))
110110

111111
# Prepare comment content
112112
result_text = read_result_file()
@@ -116,7 +116,7 @@ def add_pr_comments() -> int:
116116
else f"{FAILURE_TITLE}```\n{result_text}\n```"
117117
)
118118

119-
issue.create_comment(body=pr_comments)
119+
pr.create_comment(body=pr_comments)
120120
return 0 if result_text is None else 1
121121
except Exception as e:
122122
print(f"Error posting PR comment: {e}", file=sys.stderr)

0 commit comments

Comments
 (0)