Skip to content

Commit

Permalink
add error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
hayawata3626 committed Oct 16, 2023
1 parent 1efcc69 commit 5e912ba
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion badges/coverage.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ export async function run(): Promise<void> {
}
)

if (response.data.length === 0) {
core.setFailed(
'There are no reviews for this pull request yet. Or the url is incorrect.'
)
}

const approvedReviews = response.data.filter(
(review: Review) => review.state === 'APPROVED'
)
Expand Down

0 comments on commit 5e912ba

Please sign in to comment.