3636 run : |
3737 # 通过 GitHub API 获取 PR 的变更文件列表
3838 changed_files=$(curl -s \
39- -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN_AUTO_REVIEW }}" \
39+ -H "Authorization: Bearer ${{ secrets.ACTION_TOKEN_AUTO_REVIEW }}" \
4040 "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files" | \
4141 jq -r '.[].filename') # 使用 jq 提取文件名
4242
8787
8888 # 获取 PR 的所有评论
8989 comments=$(curl -s \
90- -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN_AUTO_REVIEW }}" \
90+ -H "Authorization: Bearer ${{ secrets.ACTION_TOKEN_AUTO_REVIEW }}" \
9191 "https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments")
9292
9393 echo '#!/bin/bash' > approval_data.sh
@@ -168,7 +168,7 @@ jobs:
168168 run : |
169169 # 查找现有的 bot 评论
170170 existing_comment=$(curl -s \
171- -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN_AUTO_REVIEW }}" \
171+ -H "Authorization: Bearer ${{ secrets.ACTION_TOKEN_AUTO_REVIEW }}" \
172172 "https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments" | \
173173 jq -r '.[] | select(.user.login == "github-actions[bot]") | {id: .id, body: .body} | @base64')
174174
@@ -177,14 +177,14 @@ jobs:
177177 comment_id=$(echo "$existing_comment" | head -1 | base64 -d | jq -r .id)
178178 echo "Updating existing comment $comment_id"
179179 response=$(curl -s -X PATCH \
180- -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN_AUTO_REVIEW }}" \
180+ -H "Authorization: Bearer ${{ secrets.ACTION_TOKEN_AUTO_REVIEW }}" \
181181 -d "$(jq -n --arg body "$(cat review_data.md)" '{body: $body}')" \
182182 "https://api.github.com/repos/${{ github.repository }}/issues/comments/$comment_id")
183183 else
184184 # 创建新评论
185185 echo "Creating new comment"
186186 response=$(curl -s -X POST \
187- -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN_AUTO_REVIEW }}" \
187+ -H "Authorization: Bearer ${{ secrets.ACTION_TOKEN_AUTO_REVIEW }}" \
188188 -d "$(jq -n --arg body "$(cat review_data.md)" '{body: $body}')" \
189189 "https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments")
190190 fi
0 commit comments