88# 2025-01-21 kurisaW Initial version
99#
1010
11- # Script Function Description: Assign PR reviews based on the MAINTAINERS list.asdasdasd
11+ # Script Function Description: Assign PR reviews based on the MAINTAINERS list.asdasdasdasdads
1212
1313name : Auto Review Assistant
1414
9797
9898 # 获取 PR 的所有评论
9999 comments=$(curl -s \
100- -H "Authorization: Bearer ${{ secrets.ACTION_TOKEN_AUTO_REVIEW }}" \
100+ -H "Authorization: Bearer ${{ github.token }}" \
101101 "https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments")
102102
103103 echo '#!/bin/bash' > approval_data.sh
@@ -178,7 +178,7 @@ jobs:
178178 run : |
179179 # 查找现有的 bot 评论
180180 existing_comment=$(curl -s \
181- -H "Authorization: Bearer ${{ secrets.ACTION_TOKEN_AUTO_REVIEW }}" \
181+ -H "Authorization: Bearer ${{ github.token }}" \
182182 "https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments" | \
183183 jq -r '.[] | select(.user.login == "github-actions[bot]") | {id: .id, body: .body} | @base64')
184184
@@ -187,14 +187,14 @@ jobs:
187187 comment_id=$(echo "$existing_comment" | head -1 | base64 -d | jq -r .id)
188188 echo "Updating existing comment $comment_id"
189189 response=$(curl -s -X PATCH \
190- -H "Authorization: Bearer ${{ secrets.ACTION_TOKEN_AUTO_REVIEW }}" \
190+ -H "Authorization: Bearer ${{ github.token }}" \
191191 -d "$(jq -n --arg body "$(cat review_data.md)" '{body: $body}')" \
192192 "https://api.github.com/repos/${{ github.repository }}/issues/comments/$comment_id")
193193 else
194194 # 创建新评论
195195 echo "Creating new comment"
196196 response=$(curl -s -X POST \
197- -H "Authorization: Bearer ${{ secrets.ACTION_TOKEN_AUTO_REVIEW }}" \
197+ -H "Authorization: Bearer ${{ github.token }}" \
198198 -d "$(jq -n --arg body "$(cat review_data.md)" '{body: $body}')" \
199199 "https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments")
200200 fi
0 commit comments