Skip to content

Commit 64ee88c

Browse files
committed
#2378: iterate
1 parent 5772f22 commit 64ee88c

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

.github/workflows/run-clang-format.yml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,26 @@ jobs:
2323
script: |
2424
let commentId = -1
2525
26-
const response = await github.paginate(
26+
for await (const { data : comments } of await github.paginate.iterator(
2727
github.rest.issues.listComments, {
2828
owner: context.repo.owner,
2929
repo: context.repo.repo,
3030
issue_number: context.issue.number
31-
},
32-
(response) => response.data
33-
)
31+
}
32+
)) {
33+
const foundComment = comments.find((comment) =>
34+
comment.body.startsWith(
35+
'`clang-format` output for this changeset:'
36+
)
37+
)
38+
39+
if (foundComment) {
40+
commentId = foundComment.id
41+
break
42+
}
43+
}
44+
45+
3446
console.log(response)
3547
3648
console.log(commentId)

0 commit comments

Comments
 (0)