diff --git a/src/Runner.Worker/Handlers/OutputManager.cs b/src/Runner.Worker/Handlers/OutputManager.cs index a67e35e21..c99370121 100644 --- a/src/Runner.Worker/Handlers/OutputManager.cs +++ b/src/Runner.Worker/Handlers/OutputManager.cs @@ -154,6 +154,12 @@ namespace GitHub.Runner.Worker.Handlers if (line.Contains("fatal: unsafe repository", StringComparison.OrdinalIgnoreCase)) { _executionContext.StepTelemetry.ErrorMessages.Add(line); + var gitUnsafeDirNotice = new DTWebApi.Issue + { + Message = $"You may experience error caused by a recently git safe directory enforcement. For more information see: https://github.blog/changelog/xxx", + Type = DTWebApi.IssueType.Notice, + }; + _executionContext.AddIssue(gitUnsafeDirNotice); } // Regular output diff --git a/src/Test/L0/Worker/OutputManagerL0.cs b/src/Test/L0/Worker/OutputManagerL0.cs index 85045802a..dd5de3136 100644 --- a/src/Test/L0/Worker/OutputManagerL0.cs +++ b/src/Test/L0/Worker/OutputManagerL0.cs @@ -947,6 +947,7 @@ namespace GitHub.Runner.Common.Tests.Worker { Process("fatal: unsafe repository ('/github/workspace' is owned by someone else)"); Assert.Contains("fatal: unsafe repository ('/github/workspace' is owned by someone else)", _executionContext.Object.StepTelemetry.ErrorMessages); + Assert.Contains(_issues, x => x.Item1.Type == DTWebApi.IssueType.Notice && x.Item1.Message.Contains("You may experience error caused by a recently git safe directory enforcement")); } }