Skip to content

Commit 110eb3a

Browse files
authored
Add generateIdTokenUrl to env vars for actions. (#1234)
1 parent bd1341e commit 110eb3a

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

src/Runner.Worker/Handlers/ContainerActionHandler.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System.Collections.Generic;
1+
using System.Collections.Generic;
22
using System.IO;
33
using System.Threading.Tasks;
44
using System;
@@ -214,6 +214,10 @@ public async Task RunAsync(ActionRunStage stage)
214214
{
215215
Environment["ACTIONS_CACHE_URL"] = cacheUrl;
216216
}
217+
if (systemConnection.Data.TryGetValue("GenerateIdTokenUrl", out var generateIdTokenUrl) && !string.IsNullOrEmpty(generateIdTokenUrl))
218+
{
219+
Environment["ACTIONS_ID_TOKEN_REQUEST_URL"] = generateIdTokenUrl;
220+
}
217221

218222
foreach (var variable in this.Environment)
219223
{

src/Runner.Worker/Handlers/NodeScriptActionHandler.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ public async Task RunAsync(ActionRunStage stage)
5353
{
5454
Environment["ACTIONS_CACHE_URL"] = cacheUrl;
5555
}
56+
if (systemConnection.Data.TryGetValue("GenerateIdTokenUrl", out var generateIdTokenUrl) && !string.IsNullOrEmpty(generateIdTokenUrl))
57+
{
58+
Environment["ACTIONS_ID_TOKEN_REQUEST_URL"] = generateIdTokenUrl;
59+
}
5660

5761
// Resolve the target script.
5862
string target = null;
@@ -72,7 +76,8 @@ public async Task RunAsync(ActionRunStage stage)
7276
// Add Telemetry to JobContext to send with JobCompleteMessage
7377
if (stage == ActionRunStage.Main)
7478
{
75-
var telemetry = new ActionsStepTelemetry {
79+
var telemetry = new ActionsStepTelemetry
80+
{
7681
Ref = GetActionRef(),
7782
HasPreStep = Data.HasPre,
7883
HasPostStep = Data.HasPost,

0 commit comments

Comments
 (0)