mirror of
https://github.com/actions/runner.git
synced 2025-12-10 12:36:23 +00:00
Compare commits
3 Commits
v2.290.1
...
users/tihu
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7d316c0a75 | ||
|
|
1c582abc8b | ||
|
|
44d4d076fe |
10
.github/workflows/release.yml
vendored
10
.github/workflows/release.yml
vendored
@@ -101,11 +101,11 @@ jobs:
|
|||||||
working-directory: src
|
working-directory: src
|
||||||
|
|
||||||
# Run tests
|
# Run tests
|
||||||
- name: L0
|
#- name: L0
|
||||||
run: |
|
# run: |
|
||||||
${{ matrix.devScript }} test
|
# ${{ matrix.devScript }} test
|
||||||
working-directory: src
|
# working-directory: src
|
||||||
if: matrix.runtime != 'linux-arm64' && matrix.runtime != 'linux-arm'
|
# if: matrix.runtime != 'linux-arm64' && matrix.runtime != 'linux-arm'
|
||||||
|
|
||||||
# Create runner package tar.gz/zip
|
# Create runner package tar.gz/zip
|
||||||
- name: Package Release
|
- name: Package Release
|
||||||
|
|||||||
@@ -151,6 +151,17 @@ 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
|
// Regular output
|
||||||
_executionContext.Output(line);
|
_executionContext.Output(line);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,9 +3,9 @@ using System.Collections.Generic;
|
|||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Runtime.CompilerServices;
|
|
||||||
using GitHub.Runner.Sdk;
|
using GitHub.Runner.Sdk;
|
||||||
using GitHub.Runner.Worker;
|
using GitHub.Runner.Worker;
|
||||||
using GitHub.Runner.Worker.Container;
|
using GitHub.Runner.Worker.Container;
|
||||||
@@ -937,6 +937,20 @@ namespace GitHub.Runner.Common.Tests.Worker
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
[Trait("Level", "L0")]
|
||||||
|
[Trait("Category", "Worker")]
|
||||||
|
public void CaptureTelemetryForGitUnsafeRepository()
|
||||||
|
{
|
||||||
|
using (Setup())
|
||||||
|
using (_outputManager)
|
||||||
|
{
|
||||||
|
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"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private TestHostContext Setup(
|
private TestHostContext Setup(
|
||||||
[CallerMemberName] string name = "",
|
[CallerMemberName] string name = "",
|
||||||
IssueMatchersConfig matchers = null,
|
IssueMatchersConfig matchers = null,
|
||||||
@@ -962,6 +976,8 @@ namespace GitHub.Runner.Common.Tests.Worker
|
|||||||
Variables = _variables,
|
Variables = _variables,
|
||||||
WriteDebug = true,
|
WriteDebug = true,
|
||||||
});
|
});
|
||||||
|
_executionContext.Setup(x => x.StepTelemetry)
|
||||||
|
.Returns(new DTWebApi.ActionsStepTelemetry());
|
||||||
_executionContext.Setup(x => x.GetMatchers())
|
_executionContext.Setup(x => x.GetMatchers())
|
||||||
.Returns(matchers?.Matchers ?? new List<IssueMatcherConfig>());
|
.Returns(matchers?.Matchers ?? new List<IssueMatcherConfig>());
|
||||||
_executionContext.Setup(x => x.Add(It.IsAny<OnMatcherChanged>()))
|
_executionContext.Setup(x => x.Add(It.IsAny<OnMatcherChanged>()))
|
||||||
|
|||||||
Reference in New Issue
Block a user