Skip to content

[BUG] GitHubReview['state'] type does not match current GitHub review states #1443

Open
@clayton-duarte

Description

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:

  1. Open a new PR;
  2. Ask someone to request changes on that PR;
  3. Inside your dangerfile check the return of reviews.find((review) => review.state === 'REQUEST_CHANGES');
  4. This will not return the review you are looking for;
  5. Now try reviews.find((review) => review.state === 'CHANGES_REQUESTED');
  6. This will return yourreview;

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

software version
danger.js 11.2.8
node v18.19.0
npm 10.2.3
Operating System MacOS

Additional context
I've checked the most recent danger releases and the latest 12.1.0 release still presents this issue.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    You Can Do ThisThis idea is well spec'd and ready for a PRbug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions