diff --git a/.github/workflows/dismissed-review.yml b/.github/workflows/dismissed-review.yml index 1d99c1c9cf06..224ea0af7249 100644 --- a/.github/workflows/dismissed-review.yml +++ b/.github/workflows/dismissed-review.yml @@ -49,7 +49,7 @@ jobs: repo: context.repo.repo, pull_number: pull_request.number })).filter(review => - review.user.login == 'github-actions[bot]' && + review.user?.login == 'github-actions[bot]' && review.state == 'DISMISSED' ).map(review => github.graphql(` mutation($node_id:ID!) { diff --git a/ci/github-script/reviews.js b/ci/github-script/reviews.js index 107ec3975c98..f10f141d84cb 100644 --- a/ci/github-script/reviews.js +++ b/ci/github-script/reviews.js @@ -12,7 +12,7 @@ async function dismissReviews({ github, context, dry }) { pull_number, }) ) - .filter((review) => review.user.login === 'github-actions[bot]') + .filter((review) => review.user?.login === 'github-actions[bot]') .map(async (review) => { if (review.state === 'CHANGES_REQUESTED') { await github.rest.pulls.dismissReview({ @@ -46,7 +46,7 @@ async function postReview({ github, context, core, dry, body }) { }) ).find( (review) => - review.user.login === 'github-actions[bot]' && + review.user?.login === 'github-actions[bot]' && // If a review is still pending, we can just update this instead // of posting a new one. (review.state === 'CHANGES_REQUESTED' ||