Skip to content

Commit

Permalink
Split out the nil and non-verified checks
Browse files Browse the repository at this point in the history
  • Loading branch information
pmaslana committed Aug 18, 2024
1 parent cb1f000 commit 6173a8f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions internal/github/checkUnsigned.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,12 @@ func hasUnsignedCommits(ctx context.Context, githubClient *github.Client, pr *gi
continue
}
verification := commit.Commit.Verification
if verification == nil || !*verification.Verified {
if verification == nil {
slogs.Logr.Info("Commit has no verification field", "commit_sha", commit.GetSHA(), "author", commit.Commit.Author.GetName(), "email", commit.Commit.Author.GetEmail())
return true, nil // Log and flag if no verification field
} else if !*verification.Verified {
slogs.Logr.Info("Commit is not verified", "commit_sha", commit.GetSHA(), "author", commit.Commit.Author.GetName(), "email", commit.Commit.Author.GetEmail(), "reason", verification.GetReason())
return true, nil
return true, nil // Log and flag if the commit is not verified
}
}
unsignedCancel() // Clean up the context at the end of the loop iteration
Expand Down

0 comments on commit 6173a8f

Please sign in to comment.