mirror of
https://github.com/actions/runner.git
synced 2026-03-31 06:23:06 +08:00
Add notice annotation for the git unsafe directory error.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user