New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] GitHubReview['state'] type does not match current GitHub review states #1443
Comments
Sure, you're welcome to add it |
Thanks for the quick reply @orta ! I'll be very happy to contribute, I just have a question before start working on a PR. I was checking the codebase and found out Danger uses github's REST API. With that in mind, I was checking their documentation and I have not-so-good news. They do not have a proper enum for that field: https://docs.github.com/en/rest/pulls/reviews#get-a-review-for-a-pull-request So, my suggestion is to simply change What do you suggest? |
from their response schema:
|
Maybe change it to be the existing literal array with |
Describe the bug
The current
GitHubReview.state
type definition is"APPROVED" | "REQUEST_CHANGES" | "COMMENT" | "PENDING" | undefined.
But while trying to catch if a PR had any requested changes I found out that the state returned by GitHub is actually
CHANGES_REQUESTED
.To Reproduce
Steps to reproduce the behavior:
dangerfile
check the return ofreviews.find((review) => review.state === 'REQUEST_CHANGES')
;reviews.find((review) => review.state === 'CHANGES_REQUESTED')
;Expected behavior
GitHubReview.state
type should correctly reflect the expected strings from GitHub;Screenshots
If applicable, add screenshots to help explain your problem.
Your Environment
Additional context
I've checked the most recent
danger
releases and the latest12.1.0
release still presents this issue.The text was updated successfully, but these errors were encountered: