Skip to content

Commit f66c53a

Browse files
committed
Resolve GH_TOKEN conflict in auto-reviewer workflow
1 parent 8ed1134 commit f66c53a

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

.github/workflows/auto-review.yml

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

33
on:
44
pull_request_target:
5-
types: [opened, ready_for_review]
5+
types: [opened, ready_for_review, synchronize]
6+
workflow_dispatch: {}
67

78
permissions:
89
pull-requests: write
@@ -27,12 +28,17 @@ jobs:
2728
pip install pyyaml
2829
2930
- name: Authenticate with GitHub
30-
run: echo "${{ secrets.GH_PAT }}" | gh auth login --with-token
31-
env:
32-
GH_TOKEN: ${{ secrets.GH_PAT }}
31+
run: |
32+
if [ -z "${{ secrets.GH_PAT }}" ]; then
33+
echo "Error: GH_PAT secret is not set"
34+
exit 1
35+
fi
36+
# Use PAT directly without gh auth login
37+
echo "Using PAT for authentication"
3338
3439
- name: Assign reviewer
3540
env:
3641
PR_NUMBER: ${{ github.event.pull_request.number }}
42+
GH_TOKEN: ${{ secrets.GH_PAT }}
3743
run: |
3844
python .github/scripts/assign_reviewer.py

0 commit comments

Comments
 (0)