mirror of
https://github.com/actions/runner.git
synced 2025-12-12 23:46:12 +00:00
Compare commits
5 Commits
users/tihu
...
hross-sln-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
faa6cbf527 | ||
|
|
8109c962f0 | ||
|
|
af198237ca | ||
|
|
1559ff15ec | ||
|
|
67ff8d3460 |
13
.github/workflows/build.yml
vendored
13
.github/workflows/build.yml
vendored
@@ -71,16 +71,3 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: runner-package-${{ matrix.runtime }}
|
name: runner-package-${{ matrix.runtime }}
|
||||||
path: _package
|
path: _package
|
||||||
|
|
||||||
# compute shas and set as job outputs to use in release notes
|
|
||||||
- run: brew install coreutils #needed for shasum util
|
|
||||||
if: ${{ matrix.os == 'macOS-latest' }}
|
|
||||||
name: Install Dependencies for SHA Calculation (osx)
|
|
||||||
- run: |
|
|
||||||
file=$(ls)
|
|
||||||
sha=$(sha256sum $file | awk '{ print $1 }')
|
|
||||||
echo "Computed sha256: $sha for $file"
|
|
||||||
shell: bash
|
|
||||||
id: sha
|
|
||||||
name: Compute SHA256
|
|
||||||
working-directory: _package
|
|
||||||
|
|||||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -23,6 +23,3 @@ TestResults
|
|||||||
TestLogs
|
TestLogs
|
||||||
.DS_Store
|
.DS_Store
|
||||||
**/*.DotSettings.user
|
**/*.DotSettings.user
|
||||||
|
|
||||||
#generated
|
|
||||||
src/Runner.Sdk/BuildConstants.cs
|
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
2.277.1
|
<Update to ./src/runnerversion when creating release>
|
||||||
|
|||||||
@@ -48,10 +48,7 @@ then
|
|||||||
echo "--------Debian Version--------"
|
echo "--------Debian Version--------"
|
||||||
cat /etc/debian_version
|
cat /etc/debian_version
|
||||||
echo "------------------------------"
|
echo "------------------------------"
|
||||||
|
|
||||||
mv /etc/apt/sources.list.d/sbt.list sbt.list
|
|
||||||
mv /etc/apt/sources.list.d/sbt.list.save sbt.list.save
|
|
||||||
|
|
||||||
# prefer apt-get over apt
|
# prefer apt-get over apt
|
||||||
command -v apt-get
|
command -v apt-get
|
||||||
if [ $? -eq 0 ]
|
if [ $? -eq 0 ]
|
||||||
|
|||||||
@@ -84,6 +84,7 @@ namespace GitHub.Runner.Common
|
|||||||
this.SecretMasker.AddValueEncoder(ValueEncoders.Base64StringEscape);
|
this.SecretMasker.AddValueEncoder(ValueEncoders.Base64StringEscape);
|
||||||
this.SecretMasker.AddValueEncoder(ValueEncoders.Base64StringEscapeShift1);
|
this.SecretMasker.AddValueEncoder(ValueEncoders.Base64StringEscapeShift1);
|
||||||
this.SecretMasker.AddValueEncoder(ValueEncoders.Base64StringEscapeShift2);
|
this.SecretMasker.AddValueEncoder(ValueEncoders.Base64StringEscapeShift2);
|
||||||
|
this.SecretMasker.AddValueEncoder(ValueEncoders.CommandLineArgumentEscape);
|
||||||
this.SecretMasker.AddValueEncoder(ValueEncoders.ExpressionStringEscape);
|
this.SecretMasker.AddValueEncoder(ValueEncoders.ExpressionStringEscape);
|
||||||
this.SecretMasker.AddValueEncoder(ValueEncoders.JsonStringEscape);
|
this.SecretMasker.AddValueEncoder(ValueEncoders.JsonStringEscape);
|
||||||
this.SecretMasker.AddValueEncoder(ValueEncoders.UriDataEscape);
|
this.SecretMasker.AddValueEncoder(ValueEncoders.UriDataEscape);
|
||||||
|
|||||||
@@ -225,7 +225,7 @@ namespace GitHub.Runner.Listener
|
|||||||
using (FileStream fs = new FileStream(archiveFile, FileMode.Create, FileAccess.Write, FileShare.None, bufferSize: 4096, useAsync: true))
|
using (FileStream fs = new FileStream(archiveFile, FileMode.Create, FileAccess.Write, FileShare.None, bufferSize: 4096, useAsync: true))
|
||||||
using (Stream result = await httpClient.GetStreamAsync(_targetPackage.DownloadUrl))
|
using (Stream result = await httpClient.GetStreamAsync(_targetPackage.DownloadUrl))
|
||||||
{
|
{
|
||||||
//81920 is the default used by System.IO.Stream.CopyTo and is under the large object heap threshold (85k).
|
//81920 is the default used by System.IO.Stream.CopyTo and is under the large object heap threshold (85k).
|
||||||
await result.CopyToAsync(fs, 81920, downloadCts.Token);
|
await result.CopyToAsync(fs, 81920, downloadCts.Token);
|
||||||
await fs.FlushAsync(downloadCts.Token);
|
await fs.FlushAsync(downloadCts.Token);
|
||||||
}
|
}
|
||||||
@@ -357,8 +357,13 @@ namespace GitHub.Runner.Listener
|
|||||||
Trace.Info($"Copy any remaining .sh/.cmd files into runner root.");
|
Trace.Info($"Copy any remaining .sh/.cmd files into runner root.");
|
||||||
foreach (FileInfo file in new DirectoryInfo(latestRunnerDirectory).GetFiles() ?? new FileInfo[0])
|
foreach (FileInfo file in new DirectoryInfo(latestRunnerDirectory).GetFiles() ?? new FileInfo[0])
|
||||||
{
|
{
|
||||||
// Copy and replace the file.
|
string destination = Path.Combine(HostContext.GetDirectory(WellKnownDirectory.Root), file.Name);
|
||||||
file.CopyTo(Path.Combine(HostContext.GetDirectory(WellKnownDirectory.Root), file.Name), true);
|
|
||||||
|
// Removing the file instead of just trying to overwrite it works around permissions issues on linux.
|
||||||
|
// https://github.com/actions/runner/issues/981
|
||||||
|
Trace.Info($"Copy {file.FullName} to {destination}");
|
||||||
|
IOUtil.DeleteFile(destination);
|
||||||
|
file.CopyTo(destination, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
BIN
src/Runner.Sdk/BuildConstants.cs
Normal file
BIN
src/Runner.Sdk/BuildConstants.cs
Normal file
Binary file not shown.
@@ -198,8 +198,7 @@ namespace GitHub.Runner.Worker
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Add at a later date. This currently no local package registry to test with
|
UpdateRegistryAuthForGitHubToken(executionContext, container);
|
||||||
// UpdateRegistryAuthForGitHubToken(executionContext, container);
|
|
||||||
|
|
||||||
// Before pulling, generate client authentication if required
|
// Before pulling, generate client authentication if required
|
||||||
var configLocation = await ContainerRegistryLogin(executionContext, container);
|
var configLocation = await ContainerRegistryLogin(executionContext, container);
|
||||||
@@ -494,31 +493,14 @@ namespace GitHub.Runner.Worker
|
|||||||
|
|
||||||
private void UpdateRegistryAuthForGitHubToken(IExecutionContext executionContext, ContainerInfo container)
|
private void UpdateRegistryAuthForGitHubToken(IExecutionContext executionContext, ContainerInfo container)
|
||||||
{
|
{
|
||||||
var registryIsTokenCompatible = container.RegistryServer.Equals("docker.pkg.github.com", StringComparison.OrdinalIgnoreCase);
|
var registryIsTokenCompatible = container.RegistryServer.Equals("ghcr.io", StringComparison.OrdinalIgnoreCase) || container.RegistryServer.Equals("containers.pkg.github.com", StringComparison.OrdinalIgnoreCase);
|
||||||
if (!registryIsTokenCompatible)
|
if (!registryIsTokenCompatible)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var registryMatchesWorkflow = false;
|
|
||||||
|
|
||||||
// REGISTRY/OWNER/REPO/IMAGE[:TAG]
|
|
||||||
var imageParts = container.ContainerImage.Split('/');
|
|
||||||
if (imageParts.Length != 4)
|
|
||||||
{
|
|
||||||
executionContext.Warning($"Could not identify owner and repo for container image {container.ContainerImage}. Skipping automatic token auth");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
var owner = imageParts[1];
|
|
||||||
var repo = imageParts[2];
|
|
||||||
var nwo = $"{owner}/{repo}";
|
|
||||||
if (nwo.Equals(executionContext.GetGitHubContext("repository"), StringComparison.OrdinalIgnoreCase))
|
|
||||||
{
|
|
||||||
registryMatchesWorkflow = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
var registryCredentialsNotSupplied = string.IsNullOrEmpty(container.RegistryAuthUsername) && string.IsNullOrEmpty(container.RegistryAuthPassword);
|
var registryCredentialsNotSupplied = string.IsNullOrEmpty(container.RegistryAuthUsername) && string.IsNullOrEmpty(container.RegistryAuthPassword);
|
||||||
if (registryCredentialsNotSupplied && registryMatchesWorkflow)
|
if (registryCredentialsNotSupplied)
|
||||||
{
|
{
|
||||||
container.RegistryAuthUsername = executionContext.GetGitHubContext("actor");
|
container.RegistryAuthUsername = executionContext.GetGitHubContext("actor");
|
||||||
container.RegistryAuthPassword = executionContext.GetGitHubContext("token");
|
container.RegistryAuthPassword = executionContext.GetGitHubContext("token");
|
||||||
|
|||||||
@@ -37,6 +37,12 @@ namespace GitHub.DistributedTask.Logging
|
|||||||
return Base64StringEscapeShift(value, 2);
|
return Base64StringEscapeShift(value, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Used when we pass environment variables to docker to escape " with \"
|
||||||
|
public static String CommandLineArgumentEscape(String value)
|
||||||
|
{
|
||||||
|
return value.Replace("\"", "\\\"");
|
||||||
|
}
|
||||||
|
|
||||||
public static String ExpressionStringEscape(String value)
|
public static String ExpressionStringEscape(String value)
|
||||||
{
|
{
|
||||||
return Expressions2.Sdk.ExpressionUtility.StringEscape(value);
|
return Expressions2.Sdk.ExpressionUtility.StringEscape(value);
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ namespace GitHub.Runner.Common.Tests
|
|||||||
string existingShScript = File.ReadAllText(Path.Combine(TestUtil.GetSrcPath(), "Misc/dotnet-install.sh"));
|
string existingShScript = File.ReadAllText(Path.Combine(TestUtil.GetSrcPath(), "Misc/dotnet-install.sh"));
|
||||||
|
|
||||||
bool shScriptMatched = string.Equals(shScript.TrimEnd('\n', '\r', '\0').Replace("\r\n", "\n").Replace("\r", "\n"), existingShScript.TrimEnd('\n', '\r', '\0').Replace("\r\n", "\n").Replace("\r", "\n"));
|
bool shScriptMatched = string.Equals(shScript.TrimEnd('\n', '\r', '\0').Replace("\r\n", "\n").Replace("\r", "\n"), existingShScript.TrimEnd('\n', '\r', '\0').Replace("\r\n", "\n").Replace("\r", "\n"));
|
||||||
//Assert.True(shScriptMatched, "Fix the test by updating Src/Misc/dotnet-install.sh with content from https://dot.net/v1/dotnet-install.sh");
|
Assert.True(shScriptMatched, "Fix the test by updating Src/Misc/dotnet-install.sh with content from https://dot.net/v1/dotnet-install.sh");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,7 +64,7 @@ namespace GitHub.Runner.Common.Tests
|
|||||||
string existingPs1Script = File.ReadAllText(Path.Combine(TestUtil.GetSrcPath(), "Misc/dotnet-install.ps1"));
|
string existingPs1Script = File.ReadAllText(Path.Combine(TestUtil.GetSrcPath(), "Misc/dotnet-install.ps1"));
|
||||||
|
|
||||||
bool ps1ScriptMatched = string.Equals(ps1Script.TrimEnd('\n', '\r', '\0').Replace("\r\n", "\n").Replace("\r", "\n"), existingPs1Script.TrimEnd('\n', '\r', '\0').Replace("\r\n", "\n").Replace("\r", "\n"));
|
bool ps1ScriptMatched = string.Equals(ps1Script.TrimEnd('\n', '\r', '\0').Replace("\r\n", "\n").Replace("\r", "\n"), existingPs1Script.TrimEnd('\n', '\r', '\0').Replace("\r\n", "\n").Replace("\r", "\n"));
|
||||||
//Assert.True(ps1ScriptMatched, "Fix the test by updating Src/Misc/dotnet-install.ps1 with content from https://dot.net/v1/dotnet-install.ps1");
|
Assert.True(ps1ScriptMatched, "Fix the test by updating Src/Misc/dotnet-install.ps1 with content from https://dot.net/v1/dotnet-install.ps1");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user