mirror of
https://github.com/samsonjs/vibetunnel.git
synced 2026-04-26 15:07:39 +00:00
Improve CI commenter
This commit is contained in:
parent
ad90606f73
commit
9424ad27ca
1 changed files with 28 additions and 7 deletions
35
.github/workflows/monitor-ci.yml
vendored
35
.github/workflows/monitor-ci.yml
vendored
|
|
@ -19,6 +19,7 @@ jobs:
|
|||
steps:
|
||||
- name: Check CI Status
|
||||
uses: actions/github-script@v7
|
||||
id: check-status
|
||||
with:
|
||||
script: |
|
||||
const workflow_run = context.payload.workflow_run;
|
||||
|
|
@ -59,10 +60,30 @@ jobs:
|
|||
}
|
||||
}
|
||||
|
||||
await github.rest.issues.createComment({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: pr.number,
|
||||
body: comment
|
||||
});
|
||||
}
|
||||
// Store comment body for next step
|
||||
core.setOutput('comment_body', comment);
|
||||
core.setOutput('pr_number', pr.number.toString());
|
||||
core.setOutput('should_comment', 'true');
|
||||
} else {
|
||||
core.setOutput('should_comment', 'false');
|
||||
}
|
||||
|
||||
- name: Find Comment
|
||||
if: steps.check-status.outputs.should_comment == 'true'
|
||||
uses: peter-evans/find-comment@v3
|
||||
id: fc
|
||||
with:
|
||||
issue-number: ${{ steps.check-status.outputs.pr_number }}
|
||||
comment-author: 'github-actions[bot]'
|
||||
body-includes: '<!-- vibetunnel-ci-status -->'
|
||||
|
||||
- name: Create or Update Comment
|
||||
if: steps.check-status.outputs.should_comment == 'true'
|
||||
uses: peter-evans/create-or-update-comment@v4
|
||||
with:
|
||||
comment-id: ${{ steps.fc.outputs.comment-id }}
|
||||
issue-number: ${{ steps.check-status.outputs.pr_number }}
|
||||
body: |
|
||||
<!-- vibetunnel-ci-status -->
|
||||
${{ steps.check-status.outputs.comment_body }}
|
||||
edit-mode: replace
|
||||
Loading…
Reference in a new issue