mirror of
https://github.com/actions/runner.git
synced 2025-12-10 12:36:23 +00:00
c
This commit is contained in:
@@ -33,16 +33,24 @@ namespace GitHub.Runner.Worker
|
||||
"sha",
|
||||
"workflow",
|
||||
"workspace",
|
||||
"ref_protected",
|
||||
};
|
||||
|
||||
public IEnumerable<KeyValuePair<string, string>> GetRuntimeEnvironmentVariables()
|
||||
{
|
||||
foreach (var data in this)
|
||||
{
|
||||
if (_contextEnvAllowlist.Contains(data.Key) && data.Value is StringContextData value)
|
||||
if (_contextEnvAllowlist.Contains(data.Key))
|
||||
{
|
||||
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