Skip to content

Commit

Permalink
Expose results service endpoint as environment variable (actions#2726) (
Browse files Browse the repository at this point in the history
#306)

* Add results service url endpoint to environment

* linter: fix file encoding

Co-authored-by: Rob Herley <robherley@github.com>
  • Loading branch information
ChristopherHX and robherley authored Feb 21, 2024
1 parent 5105397 commit 9aab6f9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Runner.Worker/Handlers/ContainerActionHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,10 @@ public async Task RunAsync(ActionRunStage stage)
Environment["ACTIONS_ID_TOKEN_REQUEST_URL"] = generateIdTokenUrl;
Environment["ACTIONS_ID_TOKEN_REQUEST_TOKEN"] = systemConnection.Authorization.Parameters[EndpointAuthorizationParameters.AccessToken];
}
if (systemConnection.Data.TryGetValue("ResultsServiceUrl", out var resultsUrl) && !string.IsNullOrEmpty(resultsUrl))
{
Environment["ACTIONS_RESULTS_URL"] = resultsUrl;
}

foreach (var variable in this.Environment)
{
Expand Down
4 changes: 4 additions & 0 deletions src/Runner.Worker/Handlers/NodeScriptActionHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ public async Task RunAsync(ActionRunStage stage)
Environment["ACTIONS_ID_TOKEN_REQUEST_URL"] = generateIdTokenUrl;
Environment["ACTIONS_ID_TOKEN_REQUEST_TOKEN"] = systemConnection.Authorization.Parameters[EndpointAuthorizationParameters.AccessToken];
}
if (systemConnection.Data.TryGetValue("ResultsServiceUrl", out var resultsUrl) && !string.IsNullOrEmpty(resultsUrl))
{
Environment["ACTIONS_RESULTS_URL"] = resultsUrl;
}

// Resolve the target script.
string target = null;
Expand Down

0 comments on commit 9aab6f9

Please sign in to comment.