update github action to only post comment once (#5454)
* update github action * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) --------- Co-authored-by: 49fl <ircsurfer33@gmail.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
22
.github/workflows/check-exampleKcl.yml
vendored
22
.github/workflows/check-exampleKcl.yml
vendored
@ -26,11 +26,21 @@ jobs:
|
|||||||
const issue_number = context.payload.pull_request.number;
|
const issue_number = context.payload.pull_request.number;
|
||||||
const owner = context.repo.owner;
|
const owner = context.repo.owner;
|
||||||
const repo = context.repo.repo;
|
const repo = context.repo.repo;
|
||||||
|
|
||||||
// Post a comment on the PR
|
const { data: comments } = await github.rest.issues.listComments({
|
||||||
await github.rest.issues.createComment({
|
|
||||||
owner,
|
owner,
|
||||||
repo,
|
repo,
|
||||||
issue_number,
|
issue_number
|
||||||
body: message,
|
});
|
||||||
});
|
|
||||||
|
const commentExists = comments.some(comment => comment.body === message);
|
||||||
|
|
||||||
|
if (!commentExists) {
|
||||||
|
// Post a comment on the PR
|
||||||
|
await github.rest.issues.createComment({
|
||||||
|
owner,
|
||||||
|
repo,
|
||||||
|
issue_number,
|
||||||
|
body: message,
|
||||||
|
});
|
||||||
|
}
|
Binary file not shown.
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 49 KiB |
Reference in New Issue
Block a user