From e0d30689351e845c5cba3d679e75ec46fc429f44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20L=2E=20Hansen?= Date: Mon, 3 Jul 2023 17:31:00 -0700 Subject: [PATCH] Add environment variables for OIDC token service --- internal/app/run/runner.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/internal/app/run/runner.go b/internal/app/run/runner.go index c9f5f3e..7ad9661 100644 --- a/internal/app/run/runner.go +++ b/internal/app/run/runner.go @@ -162,6 +162,12 @@ func (r *Runner) run(ctx context.Context, task *runnerv1.Task, reporter *report. preset.Token = t } + if actionsIdTokenRequestUrl := taskContext["actions_id_token_request_url"].GetStringValue(); actionsIdTokenRequestUrl != "" { + r.envs["ACTIONS_ID_TOKEN_REQUEST_URL"] = actionsIdTokenRequestUrl + r.envs["ACTIONS_ID_TOKEN_REQUEST_TOKEN"] = taskContext["actions_id_token_request_token"].GetStringValue() + task.Secrets["ACTIONS_ID_TOKEN_REQUEST_TOKEN"] = r.envs["ACTIONS_ID_TOKEN_REQUEST_TOKEN"] + } + // use task token to action api token r.envs["ACTIONS_RUNTIME_TOKEN"] = preset.Token