Skip to content

Commit

Permalink
Merge pull request #49 from Chia-Network/add-log
Browse files Browse the repository at this point in the history
Add logging for when commits are not verified
  • Loading branch information
pmaslana authored Aug 18, 2024
2 parents f2e7977 + 6173a8f commit 34b727a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions internal/github/checkUnsigned.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,12 @@ func hasUnsignedCommits(ctx context.Context, githubClient *github.Client, pr *gi
continue
}
verification := commit.Commit.Verification
if verification == nil || !*verification.Verified {
return true, nil
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 // 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 34b727a

Please sign in to comment.