Compare commits

..

3 Commits

Author SHA1 Message Date
TingluoHuang
7d316c0a75 Add notice annotation for the git unsafe directory error. 2022-04-20 00:56:38 -04:00
Tingluo Huang
1c582abc8b Skip running L0 tests in release workflow to prevent package pollution (#1832) 2022-04-19 16:10:47 -04:00
Tingluo Huang
44d4d076fe Capture telemetry when git errors on unsafe repository. (#1823) 2022-04-13 12:48:52 -04:00
6 changed files with 14 additions and 8 deletions

View File

@@ -101,11 +101,11 @@ jobs:
working-directory: src
# Run tests
- name: L0
run: |
${{ matrix.devScript }} test
working-directory: src
if: matrix.runtime != 'linux-arm64' && matrix.runtime != 'linux-arm'
#- name: L0
# run: |
# ${{ matrix.devScript }} test
# working-directory: src
# if: matrix.runtime != 'linux-arm64' && matrix.runtime != 'linux-arm'
# Create runner package tar.gz/zip
- name: Package Release

View File

@@ -13,7 +13,6 @@
- Better exception handling when runner is configured with invalid Url or token (#1741)
- Set user agent for websocket requests (#1791)
- Gracefully handle websocket failures (#1789)
- Capture telemetry when git errors on unsafe repository. (#1823)
## Windows x64
We recommend configuring the runner in a root folder of the Windows drive (e.g. "C:\actions-runner"). This will help avoid issues related to service identity folder permissions and long file path restrictions on Windows.

View File

@@ -1 +1 @@
2.290.1
<Update to ./src/runnerversion when creating release>

View File

@@ -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

View File

@@ -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"));
}
}

View File

@@ -1 +1 @@
2.290.1
2.290.0