Skip to content

Commit

Permalink
Skip comments that do not start with @dependabot
Browse files Browse the repository at this point in the history
  • Loading branch information
mburumaxwell committed Sep 11, 2023
1 parent 5c88065 commit a5bd9e3
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions server/Tingle.Dependabot/AzureDevOpsEventHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,17 @@ public virtual async Task HandleAsync(AzureDevOpsEvent model, CancellationToken
var prId = pr.PullRequestId;
var status = pr.Status;

logger.LogInformation("PR {PullRequestId} in {RepositoryUrl} was commented on: {Content}",
prId,
adoRepository.RemoteUrl,
comment.Content);
// ensure the comment starts with @dependabot
var content = comment.Content?.Trim();
if (content is not null && content.StartsWith("@dependabot"))
{
logger.LogInformation("PR {PullRequestId} in {RepositoryUrl} was commented on: {Content}",
prId,
adoRepository.RemoteUrl,
content);

// TODO: handle the logic for comments here using events
// TODO: handle the logic for comments here using events
}
}
else
{
Expand Down

0 comments on commit a5bd9e3

Please sign in to comment.