Skip to content

Commit

Permalink
Add more logs for debugging (#54)
Browse files Browse the repository at this point in the history
* Add more Logs

* And more
  • Loading branch information
bradystroud authored Jun 10, 2024
1 parent bfa08ae commit 7bf25ee
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion SSW.Rules.AzFuncs/Functions/Widget/UpdateLatestRules.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,21 @@ await gitHubClient.PullRequest.GetAllForRepository(repositoryOwner, repositoryNa
_logger.LogInformation($"Scanning PR {pr.Number}");
if (existingCommitHashes.Contains(pr.MergeCommitSha)) break;
if (!pr.Merged) continue;
_logger.LogInformation($"PR {pr.Number} - changed files {pr.ChangedFiles}");
_logger.LogInformation($"Too big? {pr.ChangedFiles > 100}");
if (pr.ChangedFiles > 100) // Skips big PRs as these will fail
{
_logger.LogInformation($"Skipping PR {pr.Number}");
continue;
};
};

var files = await gitHubClient.PullRequest.Files(repositoryOwner, repositoryName, pr.Number);
if (files.Count > 100) // Skips big PRs as these will fail
{
_logger.LogInformation($"Skipping PR {pr.Number} (2nd check)");
continue;
};

foreach (var file in files)
{
if (!file.FileName.Contains("rule.md")) continue;
Expand Down

0 comments on commit 7bf25ee

Please sign in to comment.