Compare commits

..

2 Commits

Author SHA1 Message Date
Ferenc Hammerl
c75a77df66 Update releaseVersion 2021-11-29 17:22:57 +01:00
Ferenc Hammerl
6332f9a42f Prepare for runner 2.285.0 release (#1520) 2021-11-29 16:07:56 +00:00
7 changed files with 60 additions and 81 deletions

View File

@@ -1,19 +1,19 @@
## Features
- Expose GITHUB_REF_* as environment variable (#1314)
- Add arch to runner context (#1372)
- Support Conditional Steps in Composite Actions (#1438)
- Log current runner version in terminal (#1441)
- Print source of secret in runs (Actions/Dependabot/None) #1411
- Support node.js 16 and bump node.js 12 version #1439
## Bugs
- Makes the user keychains available to the service (#847)
- Use Actions Service health and api.github.com endpoints after connection failure on Actions Server and Hosted (#1385)
- Fix an issue where nested local composite actions did not correctly register post steps (#1433)
- Fix a bug where local node action would crash in post-steps #1481
## Misc
- Cleanup Older versions on MacOS now that we recreate node versions as needed (#1410)
- Add telemetry around runner update process. #1497
- Improve telemetry to better diagnose runner configuration issues #1487
- Clean up dependencies #1470
## 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 @@
<Update to ./src/runnerversion when creating release>
2.285.0

View File

@@ -9,7 +9,6 @@ using System.Linq;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Loader;
using System.Threading;
using System.Threading.Tasks;
@@ -26,8 +25,8 @@ namespace GitHub.Runner.Common
ISecretMasker SecretMasker { get; }
List<ProductInfoHeaderValue> UserAgents { get; }
RunnerWebProxy WebProxy { get; }
string GetDirectory(WellKnownDirectory directory, string rootCaller = "", [CallerMemberName] string caller = "");
string GetConfigFile(WellKnownConfigFile configFile, string rootCaller = "", [CallerMemberName] string caller = "");
string GetDirectory(WellKnownDirectory directory);
string GetConfigFile(WellKnownConfigFile configFile);
Tracing GetTrace(string name);
Task Delay(TimeSpan delay, CancellationToken cancellationToken);
T CreateService<T>() where T : class, IRunnerService;
@@ -214,13 +213,8 @@ namespace GitHub.Runner.Common
}
}
public string GetDirectory(WellKnownDirectory directory, string rootCaller = "", [CallerMemberName] string caller = "")
public string GetDirectory(WellKnownDirectory directory)
{
if (string.IsNullOrEmpty(rootCaller))
{
rootCaller = caller;
}
string path;
switch (directory)
{
@@ -230,29 +224,29 @@ namespace GitHub.Runner.Common
case WellKnownDirectory.Diag:
path = Path.Combine(
GetDirectory(WellKnownDirectory.Root, rootCaller),
GetDirectory(WellKnownDirectory.Root),
Constants.Path.DiagDirectory);
break;
case WellKnownDirectory.Externals:
path = Path.Combine(
GetDirectory(WellKnownDirectory.Root, rootCaller),
GetDirectory(WellKnownDirectory.Root),
Constants.Path.ExternalsDirectory);
break;
case WellKnownDirectory.Root:
path = new DirectoryInfo(GetDirectory(WellKnownDirectory.Bin, rootCaller)).Parent.FullName;
path = new DirectoryInfo(GetDirectory(WellKnownDirectory.Bin)).Parent.FullName;
break;
case WellKnownDirectory.Temp:
path = Path.Combine(
GetDirectory(WellKnownDirectory.Work, rootCaller),
GetDirectory(WellKnownDirectory.Work),
Constants.Path.TempDirectory);
break;
case WellKnownDirectory.Actions:
path = Path.Combine(
GetDirectory(WellKnownDirectory.Work, rootCaller),
GetDirectory(WellKnownDirectory.Work),
Constants.Path.ActionsDirectory);
break;
@@ -263,14 +257,14 @@ namespace GitHub.Runner.Common
if (string.IsNullOrEmpty(path))
{
path = Path.Combine(
GetDirectory(WellKnownDirectory.Work, rootCaller),
GetDirectory(WellKnownDirectory.Work),
Constants.Path.ToolDirectory);
}
break;
case WellKnownDirectory.Update:
path = Path.Combine(
GetDirectory(WellKnownDirectory.Work, rootCaller),
GetDirectory(WellKnownDirectory.Work),
Constants.Path.UpdateDirectory);
break;
@@ -280,99 +274,94 @@ namespace GitHub.Runner.Common
ArgUtil.NotNull(settings, nameof(settings));
ArgUtil.NotNullOrEmpty(settings.WorkFolder, nameof(settings.WorkFolder));
path = Path.GetFullPath(Path.Combine(
GetDirectory(WellKnownDirectory.Root, rootCaller),
GetDirectory(WellKnownDirectory.Root),
settings.WorkFolder));
break;
default:
throw new NotSupportedException($"Unexpected well known directory: '{directory}' ({rootCaller})");
throw new NotSupportedException($"Unexpected well known directory: '{directory}'");
}
_trace.Info($"Well known directory '{directory}': '{path}' ({rootCaller})");
_trace.Info($"Well known directory '{directory}': '{path}'");
return path;
}
public string GetConfigFile(WellKnownConfigFile configFile, string rootCaller = "", [CallerMemberName] string caller = "")
public string GetConfigFile(WellKnownConfigFile configFile)
{
if (string.IsNullOrEmpty(rootCaller))
{
rootCaller = caller;
}
string path;
switch (configFile)
{
case WellKnownConfigFile.Runner:
path = Path.Combine(
GetDirectory(WellKnownDirectory.Root, rootCaller),
GetDirectory(WellKnownDirectory.Root),
".runner");
break;
case WellKnownConfigFile.Credentials:
path = Path.Combine(
GetDirectory(WellKnownDirectory.Root, rootCaller),
GetDirectory(WellKnownDirectory.Root),
".credentials");
break;
case WellKnownConfigFile.MigratedCredentials:
path = Path.Combine(
GetDirectory(WellKnownDirectory.Root, rootCaller),
GetDirectory(WellKnownDirectory.Root),
".credentials_migrated");
break;
case WellKnownConfigFile.RSACredentials:
path = Path.Combine(
GetDirectory(WellKnownDirectory.Root, rootCaller),
GetDirectory(WellKnownDirectory.Root),
".credentials_rsaparams");
break;
case WellKnownConfigFile.Service:
path = Path.Combine(
GetDirectory(WellKnownDirectory.Root, rootCaller),
GetDirectory(WellKnownDirectory.Root),
".service");
break;
case WellKnownConfigFile.CredentialStore:
#if OS_OSX
path = Path.Combine(
GetDirectory(WellKnownDirectory.Root, rootCaller),
GetDirectory(WellKnownDirectory.Root),
".credential_store.keychain");
#else
path = Path.Combine(
GetDirectory(WellKnownDirectory.Root, rootCaller),
GetDirectory(WellKnownDirectory.Root),
".credential_store");
#endif
break;
case WellKnownConfigFile.Certificates:
path = Path.Combine(
GetDirectory(WellKnownDirectory.Root, rootCaller),
GetDirectory(WellKnownDirectory.Root),
".certificates");
break;
case WellKnownConfigFile.Options:
path = Path.Combine(
GetDirectory(WellKnownDirectory.Root, rootCaller),
GetDirectory(WellKnownDirectory.Root),
".options");
break;
case WellKnownConfigFile.SetupInfo:
path = Path.Combine(
GetDirectory(WellKnownDirectory.Root, rootCaller),
GetDirectory(WellKnownDirectory.Root),
".setup_info");
break;
case WellKnownConfigFile.Telemetry:
path = Path.Combine(
GetDirectory(WellKnownDirectory.Diag, rootCaller),
GetDirectory(WellKnownDirectory.Diag),
".telemetry");
break;
default:
throw new NotSupportedException($"Unexpected well known config file: '{configFile}' ({rootCaller})");
throw new NotSupportedException($"Unexpected well known config file: '{configFile}'");
}
_trace.Info($"Well known config file '{configFile}': '{path}' ({rootCaller})");
_trace.Info($"Well known config file '{configFile}': '{path}'");
return path;
}

View File

@@ -159,13 +159,8 @@ namespace GitHub.Runner.Common.Tests
_serviceSingletons[typeof(T)] = singleton;
}
public string GetDirectory(WellKnownDirectory directory, string rootCaller = "", [CallerMemberName] string caller = "")
public string GetDirectory(WellKnownDirectory directory)
{
if (string.IsNullOrEmpty(rootCaller))
{
rootCaller = caller;
}
string path;
switch (directory)
{
@@ -175,13 +170,13 @@ namespace GitHub.Runner.Common.Tests
case WellKnownDirectory.Diag:
path = Path.Combine(
GetDirectory(WellKnownDirectory.Root, rootCaller),
GetDirectory(WellKnownDirectory.Root),
Constants.Path.DiagDirectory);
break;
case WellKnownDirectory.Externals:
path = Path.Combine(
GetDirectory(WellKnownDirectory.Root, rootCaller),
GetDirectory(WellKnownDirectory.Root),
Constants.Path.ExternalsDirectory);
break;
@@ -191,13 +186,13 @@ namespace GitHub.Runner.Common.Tests
case WellKnownDirectory.Temp:
path = Path.Combine(
GetDirectory(WellKnownDirectory.Work, rootCaller),
GetDirectory(WellKnownDirectory.Work),
Constants.Path.TempDirectory);
break;
case WellKnownDirectory.Actions:
path = Path.Combine(
GetDirectory(WellKnownDirectory.Work, rootCaller),
GetDirectory(WellKnownDirectory.Work),
Constants.Path.ActionsDirectory);
break;
@@ -207,14 +202,14 @@ namespace GitHub.Runner.Common.Tests
if (string.IsNullOrEmpty(path))
{
path = Path.Combine(
GetDirectory(WellKnownDirectory.Work, rootCaller),
GetDirectory(WellKnownDirectory.Work),
Constants.Path.ToolDirectory);
}
break;
case WellKnownDirectory.Update:
path = Path.Combine(
GetDirectory(WellKnownDirectory.Work, rootCaller),
GetDirectory(WellKnownDirectory.Work),
Constants.Path.UpdateDirectory);
break;
@@ -228,71 +223,66 @@ namespace GitHub.Runner.Common.Tests
throw new NotSupportedException($"Unexpected well known directory: '{directory}'");
}
_trace.Info($"Well known directory '{directory}': '{path}' ({rootCaller})");
_trace.Info($"Well known directory '{directory}': '{path}'");
return path;
}
public string GetConfigFile(WellKnownConfigFile configFile, string rootCaller = "", [CallerMemberName] string caller = "")
public string GetConfigFile(WellKnownConfigFile configFile)
{
if (string.IsNullOrEmpty(rootCaller))
{
rootCaller = caller;
}
string path;
switch (configFile)
{
case WellKnownConfigFile.Runner:
path = Path.Combine(
GetDirectory(WellKnownDirectory.Root, rootCaller),
GetDirectory(WellKnownDirectory.Root),
".agent");
break;
case WellKnownConfigFile.Credentials:
path = Path.Combine(
GetDirectory(WellKnownDirectory.Root, rootCaller),
GetDirectory(WellKnownDirectory.Root),
".credentials");
break;
case WellKnownConfigFile.RSACredentials:
path = Path.Combine(
GetDirectory(WellKnownDirectory.Root, rootCaller),
GetDirectory(WellKnownDirectory.Root),
".credentials_rsaparams");
break;
case WellKnownConfigFile.Service:
path = Path.Combine(
GetDirectory(WellKnownDirectory.Root, rootCaller),
GetDirectory(WellKnownDirectory.Root),
".service");
break;
case WellKnownConfigFile.CredentialStore:
#if OS_OSX
path = Path.Combine(
GetDirectory(WellKnownDirectory.Root, rootCaller),
GetDirectory(WellKnownDirectory.Root),
".credential_store.keychain");
#else
path = Path.Combine(
GetDirectory(WellKnownDirectory.Root, rootCaller),
GetDirectory(WellKnownDirectory.Root),
".credential_store");
#endif
break;
case WellKnownConfigFile.Certificates:
path = Path.Combine(
GetDirectory(WellKnownDirectory.Root, rootCaller),
GetDirectory(WellKnownDirectory.Root),
".certificates");
break;
case WellKnownConfigFile.Options:
path = Path.Combine(
GetDirectory(WellKnownDirectory.Root, rootCaller),
GetDirectory(WellKnownDirectory.Root),
".options");
break;
case WellKnownConfigFile.SetupInfo:
path = Path.Combine(
GetDirectory(WellKnownDirectory.Root, rootCaller),
GetDirectory(WellKnownDirectory.Root),
".setup_info");
break;
@@ -300,7 +290,7 @@ namespace GitHub.Runner.Common.Tests
throw new NotSupportedException($"Unexpected well known config file: '{configFile}'");
}
_trace.Info($"Well known config file '{configFile}': '{path}' ({rootCaller})");
_trace.Info($"Well known config file '{configFile}': '{path}'");
return path;
}

View File

@@ -118,7 +118,7 @@ namespace GitHub.Runner.Common.Tests.Worker
await _actionRunner.RunAsync();
//Assert
_ec.Verify(x => x.SetGitHubContext("event_path", Path.Combine(_hc.GetDirectory(WellKnownDirectory.Temp, "", ""), "_github_workflow", "event.json")), Times.Once);
_ec.Verify(x => x.SetGitHubContext("event_path", Path.Combine(_hc.GetDirectory(WellKnownDirectory.Temp), "_github_workflow", "event.json")), Times.Once);
}
[Fact]

View File

@@ -153,7 +153,7 @@ namespace GitHub.Runner.Common.Tests.Worker
// Assert.
_trackingManager.Verify(x => x.LoadIfExists(_ec.Object, _trackingFile));
_trackingManager.Verify(x => x.Update(_ec.Object, _existingConfig, _trackingFile));
_ec.Verify(x => x.SetGitHubContext("workspace", Path.Combine(hc.GetDirectory(WellKnownDirectory.Work, "", ""), _existingConfig.PipelineDirectory, "my_new_path")));
_ec.Verify(x => x.SetGitHubContext("workspace", Path.Combine(hc.GetDirectory(WellKnownDirectory.Work), _existingConfig.PipelineDirectory, "my_new_path")));
}
}
@@ -190,7 +190,7 @@ namespace GitHub.Runner.Common.Tests.Worker
_trackingManager.Setup(x => x.LoadIfExists(_ec.Object, _trackingFile)).Returns(_existingConfig);
// Act.
Assert.ThrowsAny<ArgumentException>(() => _pipelineDirectoryManager.UpdateRepositoryDirectory(_ec.Object, "actions/notrunner", Path.Combine(hc.GetDirectory(WellKnownDirectory.Work), "not_under_pipeline_directory"), false));
Assert.ThrowsAny<ArgumentException>(()=> _pipelineDirectoryManager.UpdateRepositoryDirectory(_ec.Object, "actions/notrunner", Path.Combine(hc.GetDirectory(WellKnownDirectory.Work), "not_under_pipeline_directory"), false));
}
}

View File

@@ -1 +1 @@
2.284.0
2.285.0