mirror of
https://github.com/actions/runner.git
synced 2025-12-11 12:57:05 +00:00
c
This commit is contained in:
@@ -33,15 +33,23 @@ namespace GitHub.Runner.Worker
|
|||||||
"sha",
|
"sha",
|
||||||
"workflow",
|
"workflow",
|
||||||
"workspace",
|
"workspace",
|
||||||
|
"ref_protected",
|
||||||
};
|
};
|
||||||
|
|
||||||
public IEnumerable<KeyValuePair<string, string>> GetRuntimeEnvironmentVariables()
|
public IEnumerable<KeyValuePair<string, string>> GetRuntimeEnvironmentVariables()
|
||||||
{
|
{
|
||||||
foreach (var data in this)
|
foreach (var data in this)
|
||||||
{
|
{
|
||||||
if (_contextEnvAllowlist.Contains(data.Key) && data.Value is StringContextData value)
|
if (_contextEnvAllowlist.Contains(data.Key))
|
||||||
{
|
{
|
||||||
yield return new KeyValuePair<string, string>($"GITHUB_{data.Key.ToUpperInvariant()}", value);
|
if (data.Value is StringContextData value)
|
||||||
|
{
|
||||||
|
yield return new KeyValuePair<string, string>($"GITHUB_{data.Key.ToUpperInvariant()}", value);
|
||||||
|
}
|
||||||
|
else if (data.Value is BooleanContextData booleanValue)
|
||||||
|
{
|
||||||
|
yield return new KeyValuePair<string, string>($"GITHUB_{data.Key.ToUpperInvariant()}", booleanValue.ToString());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user