Skip to content

Commit 7d3e586

Browse files
authored
chore: delete previous ecosystem-ci run comments (#24)
1 parent bdce46c commit 7d3e586

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

.github/workflows/ecosystem-ci-from-pr.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,10 +241,19 @@ jobs:
241241
owner: context.repo.owner,
242242
repo: 'core'
243243
})
244+
245+
const triggerComments = comments.filter(comment =>
246+
comment.body.includes('/ecosystem-ci run')
247+
)
248+
// note: issue comments are ordered by ascending ID.
249+
// delete the previous ecosystem-ci trigger comments
250+
// just keep the latest one
251+
triggerComments.pop()
252+
244253
const workflowComments = comments.filter(comment =>
245254
comment.body.includes('Ran ecosystem CI:') || comment.body.includes('Triggered ecosystem CI:')
246255
)
247-
for (const comment of workflowComments) {
256+
for (const comment of [...workflowComments, ...triggerComments]) {
248257
await github.rest.issues.deleteComment({
249258
owner: context.repo.owner,
250259
repo: 'core',

0 commit comments

Comments
 (0)