Skip to content

Commit d3cb7fa

Browse files
committed
Allow to overwrite ACTIONS_RESULTS_URL environment variable
By introducing a new environment variable with the name of CUSTOM_ACTIONS_RESULTS_URL, allowing users of that repo to overwrite the ACTIONS_RESULTS_URL environment variable. It's required for cache v2 service.
1 parent 337dfe3 commit d3cb7fa

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/Runner.Worker/Handlers/NodeScriptActionHandler.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,15 @@ public async Task RunAsync(ActionRunStage stage)
7272
Environment["ACTIONS_ID_TOKEN_REQUEST_URL"] = generateIdTokenUrl;
7373
Environment["ACTIONS_ID_TOKEN_REQUEST_TOKEN"] = systemConnection.Authorization.Parameters[EndpointAuthorizationParameters.AccessToken];
7474
}
75-
if (systemConnection.Data.TryGetValue("ResultsServiceUrl", out var resultsUrl) && !string.IsNullOrEmpty(resultsUrl))
75+
string customResultsUrl = System.Environment.GetEnvironmentVariable("CUSTOM_ACTIONS_RESULTS_URL");
76+
if (!string.IsNullOrEmpty(customResultsUrl))
77+
{
78+
Environment["ACTIONS_RESULTS_URL"] = customResultsUrl;
79+
}
80+
else if (systemConnection.Data.TryGetValue("ResultsServiceUrl", out var resultsUrl) && !string.IsNullOrEmpty(resultsUrl))
7681
{
7782
Environment["ACTIONS_RESULTS_URL"] = resultsUrl;
7883
}
79-
8084
if (ExecutionContext.Global.Variables.GetBoolean("actions_uses_cache_service_v2") ?? false)
8185
{
8286
Environment["ACTIONS_CACHE_SERVICE_V2"] = bool.TrueString;

0 commit comments

Comments
 (0)