Skip to content

feat: add pull request state (open/closed/merged) to PullRequest struct#903

Merged
shyim merged 1 commit intomainfrom
feat/add-pull-request-state
Mar 20, 2026
Merged

feat: add pull request state (open/closed/merged) to PullRequest struct#903
shyim merged 1 commit intomainfrom
feat/add-pull-request-state

Conversation

@shyim
Copy link
Owner

@shyim shyim commented Mar 20, 2026

Summary

  • Add STATE_OPEN, STATE_CLOSED, STATE_MERGED constants to Danger\Struct\PullRequest
  • Add state property to PullRequest struct, populated from GitHub and GitLab API responses
  • GitHub platform maps merged flag and state field to the appropriate constant
  • GitLab platform maps state field using a match expression

Test plan

  • Added assertion for state in GithubTest
  • Added assertion for state in GitlabTest
  • All 18 existing tests pass

Add STATE_OPEN, STATE_CLOSED, STATE_MERGED constants and populate the
state property from GitHub and GitLab API responses so rules can inspect
the current status of a pull request.
@shyim shyim merged commit 055d1f7 into main Mar 20, 2026
7 checks passed
@shyim shyim deleted the feat/add-pull-request-state branch March 20, 2026 03:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant