Skip to content

Commit

Permalink
Fix issue PR check
Browse files Browse the repository at this point in the history
  • Loading branch information
Matyrobbrt committed Jan 12, 2025
1 parent ecb77f0 commit ee61ada
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,14 @@ public record BlockPRHandler() implements LabelHandler {

@Override
public void onLabelAdded(GitHub gitHub, GHUser actor, GHIssue issue, GHLabel label) throws Exception {
if (issue.getPullRequest() != null) {
block(issue.getRepository().getPullRequest(issue.getNumber()));
if (issue instanceof GHPullRequest pr) {
block(pr);
}
}

@Override
public void onLabelRemoved(GitHub gitHub, GHUser actor, GHIssue issue, GHLabel label) throws Exception {
if (issue.getPullRequest() != null) {
var pr = issue.getRepository().getPullRequest(issue.getNumber());
if (issue instanceof GHPullRequest pr) {
issue.getRepository()
.createCheckRun(NAME, pr.getHead().getSha())
.withConclusion(GHCheckRun.Conclusion.SUCCESS)
Expand Down

0 comments on commit ee61ada

Please sign in to comment.