mirror of
https://github.com/Wei-Shaw/claude-relay-service.git
synced 2026-01-22 16:43:35 +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"
|
||||
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
|
||||
if: failure()
|
||||
continue-on-error: true # 即使评论失败也继续
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
github-token: ${{ secrets.GH_PAT || secrets.GITHUB_TOKEN }}
|
||||
script: |
|
||||
const fs = require('fs');
|
||||
let comment = '## 🚨 Code Quality Check Failed\n\n';
|
||||
@@ -233,9 +242,10 @@ jobs:
|
||||
|
||||
- name: Success comment
|
||||
if: success() && steps.changed-files.outputs.any_changed == 'true'
|
||||
continue-on-error: true # 即使评论失败也继续
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
github-token: ${{ secrets.GH_PAT || secrets.GITHUB_TOKEN }}
|
||||
script: |
|
||||
// 查找是否已有失败的评论
|
||||
const { data: comments } = await github.rest.issues.listComments({
|
||||
|
||||
Reference in New Issue
Block a user