Skip to content

Commit

Permalink
Check if merge_commit_sha is null instead of checking mergeablility
Browse files Browse the repository at this point in the history
  • Loading branch information
drakon64 committed Nov 13, 2024
1 parent 44cd195 commit 1f65365
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Anyder/EventProcessors/GitHubWebhookEventProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ from file in await Program.GitHubClient.ListPullRequestFiles(
return;
}

bool mergeable;
string? mergeCommitSha;

while (true)
{
Expand All @@ -61,11 +61,11 @@ from file in await Program.GitHubClient.ListPullRequestFiles(
continue;
}

mergeable = pullRequest.Mergeable.Value;
mergeCommitSha = pullRequest.MergeCommitSha;
break;
}

if (!mergeable)
if (mergeCommitSha is null)
{
return;
}
Expand Down
5 changes: 5 additions & 0 deletions Elpis/Models/GitHub/PullRequest/PullRequest.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
using System.Text.Json.Serialization;

namespace Elpis.Models.GitHub.PullRequest;

public class PullRequest
{
public required bool? Mergeable { get; init; }

[JsonPropertyName("merge_commit_sha")]
public string? MergeCommitSha { get; init; }
}

0 comments on commit 1f65365

Please sign in to comment.