mirror of
https://github.com/Wei-Shaw/claude-relay-service.git
synced 2026-01-23 00:53:33 +00:00
fix: 改进 PR 评论权限处理和添加调试信息
This commit is contained in:
14
.github/workflows/pr-lint-check.yml
vendored
14
.github/workflows/pr-lint-check.yml
vendored
@@ -170,11 +170,20 @@ jobs:
|
|||||||
echo "No JavaScript files to lint"
|
echo "No JavaScript files to lint"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
- name: Debug PR Context
|
||||||
|
if: failure()
|
||||||
|
run: |
|
||||||
|
echo "PR Number: ${{ github.event.pull_request.number }}"
|
||||||
|
echo "Repo: ${{ github.repository }}"
|
||||||
|
echo "Event Name: ${{ github.event_name }}"
|
||||||
|
echo "Actor: ${{ github.actor }}"
|
||||||
|
|
||||||
- name: Comment PR with results
|
- name: Comment PR with results
|
||||||
if: failure()
|
if: failure()
|
||||||
|
continue-on-error: true # 即使评论失败也继续
|
||||||
uses: actions/github-script@v7
|
uses: actions/github-script@v7
|
||||||
with:
|
with:
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
github-token: ${{ secrets.GH_PAT || secrets.GITHUB_TOKEN }}
|
||||||
script: |
|
script: |
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
let comment = '## 🚨 Code Quality Check Failed\n\n';
|
let comment = '## 🚨 Code Quality Check Failed\n\n';
|
||||||
@@ -233,9 +242,10 @@ jobs:
|
|||||||
|
|
||||||
- name: Success comment
|
- name: Success comment
|
||||||
if: success() && steps.changed-files.outputs.any_changed == 'true'
|
if: success() && steps.changed-files.outputs.any_changed == 'true'
|
||||||
|
continue-on-error: true # 即使评论失败也继续
|
||||||
uses: actions/github-script@v7
|
uses: actions/github-script@v7
|
||||||
with:
|
with:
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
github-token: ${{ secrets.GH_PAT || secrets.GITHUB_TOKEN }}
|
||||||
script: |
|
script: |
|
||||||
// 查找是否已有失败的评论
|
// 查找是否已有失败的评论
|
||||||
const { data: comments } = await github.rest.issues.listComments({
|
const { data: comments } = await github.rest.issues.listComments({
|
||||||
|
|||||||
Reference in New Issue
Block a user