|
26 | 26 | issues: write |
27 | 27 | pull-requests: write |
28 | 28 | contents: write |
29 | | - env: |
30 | | - SUPER_SECRET: ${{ secrets.ACTION_TOKEN_AUTO_REVIEW }} |
31 | 29 | steps: |
32 | 30 | - name: Checkout code |
33 | 31 | uses: actions/checkout@v3 |
@@ -161,28 +159,28 @@ jobs: |
161 | 159 | echo "> ℹ️ **刷新CI状态操作需要具备仓库写入权限。**" |
162 | 160 | echo "> ℹ️ **Refresh CI status operation requires repository Write permission.**" |
163 | 161 | } > review_data.md |
164 | | - - name: Post/Update comment |
165 | | - id: post_comment |
166 | | - run: | |
167 | | - # 查找现有的 bot 评论 |
168 | | - existing_comment=$(curl -s \ |
169 | | - -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ |
170 | | - "https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments" | \ |
171 | | - jq -r '.[] | select(.user.login == "github-actions[bot]") | {id: .id, body: .body} | @base64') |
| 162 | + # - name: Post/Update comment |
| 163 | + # id: post_comment |
| 164 | + # run: | |
| 165 | + # # 查找现有的 bot 评论 |
| 166 | + # existing_comment=$(curl -s \ |
| 167 | + # -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ |
| 168 | + # "https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments" | \ |
| 169 | + # jq -r '.[] | select(.user.login == "github-actions[bot]") | {id: .id, body: .body} | @base64') |
172 | 170 |
|
173 | | - if [[ -n "$existing_comment" ]]; then |
174 | | - # 更新现有评论 |
175 | | - comment_id=$(echo "$existing_comment" | head -1 | base64 -d | jq -r .id) |
176 | | - echo "Updating existing comment $comment_id" |
177 | | - response=$(curl -s -X PATCH \ |
178 | | - -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ |
179 | | - -d "$(jq -n --arg body "$(cat review_data.md)" '{body: $body}')" \ |
180 | | - "https://api.github.com/repos/${{ github.repository }}/issues/comments/$comment_id") |
181 | | - else |
182 | | - # 创建新评论 |
183 | | - echo "Creating new comment" |
184 | | - response=$(curl -s -X POST \ |
185 | | - -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ |
186 | | - -d "$(jq -n --arg body "$(cat review_data.md)" '{body: $body}')" \ |
187 | | - "https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments") |
188 | | - fi |
| 171 | + # if [[ -n "$existing_comment" ]]; then |
| 172 | + # # 更新现有评论 |
| 173 | + # comment_id=$(echo "$existing_comment" | head -1 | base64 -d | jq -r .id) |
| 174 | + # echo "Updating existing comment $comment_id" |
| 175 | + # response=$(curl -s -X PATCH \ |
| 176 | + # -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ |
| 177 | + # -d "$(jq -n --arg body "$(cat review_data.md)" '{body: $body}')" \ |
| 178 | + # "https://api.github.com/repos/${{ github.repository }}/issues/comments/$comment_id") |
| 179 | + # else |
| 180 | + # # 创建新评论 |
| 181 | + # echo "Creating new comment" |
| 182 | + # response=$(curl -s -X POST \ |
| 183 | + # -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ |
| 184 | + # -d "$(jq -n --arg body "$(cat review_data.md)" '{body: $body}')" \ |
| 185 | + # "https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments") |
| 186 | + # fi |
0 commit comments