diff --git a/server/Tingle.Dependabot/AzureDevOpsEventHandler.cs b/server/Tingle.Dependabot/AzureDevOpsEventHandler.cs index 22a07d3f..cb720d7a 100644 --- a/server/Tingle.Dependabot/AzureDevOpsEventHandler.cs +++ b/server/Tingle.Dependabot/AzureDevOpsEventHandler.cs @@ -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 {