Add generateIdTokenUrl to env vars for actions. (#1234)

This commit is contained in:
Tingluo Huang
2021-08-02 14:47:50 -07:00
committed by GitHub
parent bd1341e580
commit 110eb3a5de
2 changed files with 11 additions and 2 deletions

View File

@@ -1,4 +1,4 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Threading.Tasks; using System.Threading.Tasks;
using System; using System;
@@ -214,6 +214,10 @@ namespace GitHub.Runner.Worker.Handlers
{ {
Environment["ACTIONS_CACHE_URL"] = cacheUrl; Environment["ACTIONS_CACHE_URL"] = cacheUrl;
} }
if (systemConnection.Data.TryGetValue("GenerateIdTokenUrl", out var generateIdTokenUrl) && !string.IsNullOrEmpty(generateIdTokenUrl))
{
Environment["ACTIONS_ID_TOKEN_REQUEST_URL"] = generateIdTokenUrl;
}
foreach (var variable in this.Environment) foreach (var variable in this.Environment)
{ {

View File

@@ -53,6 +53,10 @@ namespace GitHub.Runner.Worker.Handlers
{ {
Environment["ACTIONS_CACHE_URL"] = cacheUrl; Environment["ACTIONS_CACHE_URL"] = cacheUrl;
} }
if (systemConnection.Data.TryGetValue("GenerateIdTokenUrl", out var generateIdTokenUrl) && !string.IsNullOrEmpty(generateIdTokenUrl))
{
Environment["ACTIONS_ID_TOKEN_REQUEST_URL"] = generateIdTokenUrl;
}
// Resolve the target script. // Resolve the target script.
string target = null; string target = null;
@@ -72,7 +76,8 @@ namespace GitHub.Runner.Worker.Handlers
// Add Telemetry to JobContext to send with JobCompleteMessage // Add Telemetry to JobContext to send with JobCompleteMessage
if (stage == ActionRunStage.Main) if (stage == ActionRunStage.Main)
{ {
var telemetry = new ActionsStepTelemetry { var telemetry = new ActionsStepTelemetry
{
Ref = GetActionRef(), Ref = GetActionRef(),
HasPreStep = Data.HasPre, HasPreStep = Data.HasPre,
HasPostStep = Data.HasPost, HasPostStep = Data.HasPost,