Skip to content

Commit 5302c25

Browse files
scubbosorenisanerd
authored andcommitted
Add environment variables for OIDC token service (#674)
Resurrecting [this PR](https://gitea.com/gitea/act_runner/pulls/272) (a dependency of [this one](go-gitea/gitea#33945)) after the original author [lost motivation](go-gitea/gitea#25664 (comment)) - though, to be clear, all credit belongs to them, and all blame for mistakes or misunderstandings to me. Co-authored-by: Søren L. Hansen <[email protected]> Reviewed-on: https://gitea.com/gitea/act_runner/pulls/674 Reviewed-by: ChristopherHX <[email protected]> Reviewed-by: Lunny Xiao <[email protected]> Co-authored-by: Jack Jackson <[email protected]> Co-committed-by: Jack Jackson <[email protected]>
1 parent a616ed1 commit 5302c25

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

internal/app/run/runner.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,12 @@ func (r *Runner) run(ctx context.Context, task *runnerv1.Task, reporter *report.
163163
preset.Token = t
164164
}
165165

166+
if actionsIdTokenRequestUrl := taskContext["actions_id_token_request_url"].GetStringValue(); actionsIdTokenRequestUrl != "" {
167+
r.envs["ACTIONS_ID_TOKEN_REQUEST_URL"] = actionsIdTokenRequestUrl
168+
r.envs["ACTIONS_ID_TOKEN_REQUEST_TOKEN"] = taskContext["actions_id_token_request_token"].GetStringValue()
169+
task.Secrets["ACTIONS_ID_TOKEN_REQUEST_TOKEN"] = r.envs["ACTIONS_ID_TOKEN_REQUEST_TOKEN"]
170+
}
171+
166172
giteaRuntimeToken := taskContext["gitea_runtime_token"].GetStringValue()
167173
if giteaRuntimeToken == "" {
168174
// use task token to action api token for previous Gitea Server Versions

0 commit comments

Comments
 (0)