mirror of
https://github.com/samsonjs/vibetunnel.git
synced 2026-04-27 15:17:38 +00:00
Improve CI commenter
This commit is contained in:
parent
ad90606f73
commit
9424ad27ca
1 changed files with 28 additions and 7 deletions
33
.github/workflows/monitor-ci.yml
vendored
33
.github/workflows/monitor-ci.yml
vendored
|
|
@ -19,6 +19,7 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- name: Check CI Status
|
- name: Check CI Status
|
||||||
uses: actions/github-script@v7
|
uses: actions/github-script@v7
|
||||||
|
id: check-status
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
const workflow_run = context.payload.workflow_run;
|
const workflow_run = context.payload.workflow_run;
|
||||||
|
|
@ -59,10 +60,30 @@ jobs:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
await github.rest.issues.createComment({
|
// Store comment body for next step
|
||||||
owner: context.repo.owner,
|
core.setOutput('comment_body', comment);
|
||||||
repo: context.repo.repo,
|
core.setOutput('pr_number', pr.number.toString());
|
||||||
issue_number: pr.number,
|
core.setOutput('should_comment', 'true');
|
||||||
body: comment
|
} 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