Skip to content

Commit eb90374

Browse files
committed
fix: resolve GH_TOKEN auth conflict in auto-reviewer workflow
1 parent 8ed1134 commit eb90374

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

.github/workflows/auto-review.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Auto Assign Reviewer
22

33
on:
44
pull_request_target:
5-
types: [opened, ready_for_review]
5+
types: [opened, ready_for_review, synchronize]
66

77
permissions:
88
pull-requests: write
@@ -27,12 +27,17 @@ jobs:
2727
pip install pyyaml
2828
2929
- name: Authenticate with GitHub
30-
run: echo "${{ secrets.GH_PAT }}" | gh auth login --with-token
31-
env:
32-
GH_TOKEN: ${{ secrets.GH_PAT }}
30+
run: |
31+
if [ -z "${{ secrets.GH_PAT }}" ]; then
32+
echo "Error: GH_PAT secret is not set"
33+
exit 1
34+
fi
35+
# Use PAT directly without gh auth login
36+
echo "Using PAT for authentication"
3337
3438
- name: Assign reviewer
3539
env:
3640
PR_NUMBER: ${{ github.event.pull_request.number }}
41+
GH_TOKEN: ${{ secrets.GH_PAT }}
3742
run: |
3843
python .github/scripts/assign_reviewer.py

0 commit comments

Comments
 (0)