Skip to content

Commit

Permalink
Fix previous comment finding.
Browse files Browse the repository at this point in the history
  • Loading branch information
rtibbles committed Mar 19, 2022
1 parent edbb0a0 commit 8c58c23
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/pr_build_comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
let comment;
let page = 1
while (!comment) {
const comments = github.rest.issues.listComments({
const comments = await github.rest.issues.listComments({
issue_number: ${{steps.pr-number.outputs.result}},
owner: context.repo.owner,
repo: context.repo.repo,
Expand All @@ -82,10 +82,12 @@ jobs:
if (!comments.length) {
return;
}
comment = comments.find(c => c.body.includes('[**Build Artifacts**]'))
comment = comments.find(c => c.body && c.body.includes('[**Build Artifacts**]'))
if (comment) {
return comment.id.toString()
}
page += 1;
}
return comment && comment.id
- name: Create build comment
if: ${{!steps.find-comment.outputs.result}}
uses: actions/github-script@v6
Expand Down

0 comments on commit 8c58c23

Please sign in to comment.