mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2025-09-08 17:51:20 +02:00
Update PR-Demo-cleanup.yml
This commit is contained in:
parent
74aec1a72d
commit
cacc0d8994
12
.github/workflows/PR-Demo-cleanup.yml
vendored
12
.github/workflows/PR-Demo-cleanup.yml
vendored
@ -75,20 +75,22 @@ jobs:
|
||||
issue_number: prNumber
|
||||
});
|
||||
|
||||
const deploymentComment = comments.data.find(c =>
|
||||
const deploymentComments = comments.data.filter(c =>
|
||||
c.body?.includes("## 🚀 PR Test Deployment") &&
|
||||
c.user?.type === "Bot"
|
||||
);
|
||||
|
||||
if (deploymentComment) {
|
||||
if (deploymentComments.length > 0) {
|
||||
for (const comment of deploymentComments) {
|
||||
await github.rest.issues.deleteComment({
|
||||
owner,
|
||||
repo,
|
||||
comment_id: deploymentComment.id
|
||||
comment_id: comment.id
|
||||
});
|
||||
console.log(`Deleted deployment comment (ID: ${deploymentComment.id})`);
|
||||
console.log(`Deleted deployment comment (ID: ${comment.id})`);
|
||||
}
|
||||
} else {
|
||||
console.log("No matching deployment comment found.");
|
||||
console.log("No matching deployment comments found.");
|
||||
}
|
||||
core.setOutput('present', hasLabel || deploymentComment ? 'true' : 'false');
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user