Use artifacts v4 jwt if available
This commit is contained in:
parent
f17cad1bbe
commit
58a3ef40e8
@ -162,8 +162,12 @@ func (r *Runner) run(ctx context.Context, task *runnerv1.Task, reporter *report.
|
|||||||
preset.Token = t
|
preset.Token = t
|
||||||
}
|
}
|
||||||
|
|
||||||
// use task token to action api token
|
giteaRuntimeToken := taskContext["gitea_runtime_token"].GetStringValue()
|
||||||
r.envs["ACTIONS_RUNTIME_TOKEN"] = preset.Token
|
if giteaRuntimeToken == "" {
|
||||||
|
// use task token to action api token for previous Gitea Server Versions
|
||||||
|
giteaRuntimeToken = preset.Token
|
||||||
|
}
|
||||||
|
r.envs["ACTIONS_RUNTIME_TOKEN"] = giteaRuntimeToken
|
||||||
|
|
||||||
eventJSON, err := json.Marshal(preset.Event)
|
eventJSON, err := json.Marshal(preset.Event)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -47,6 +47,9 @@ func NewReporter(ctx context.Context, cancel context.CancelFunc, client client.C
|
|||||||
if v := task.Context.Fields["token"].GetStringValue(); v != "" {
|
if v := task.Context.Fields["token"].GetStringValue(); v != "" {
|
||||||
oldnew = append(oldnew, v, "***")
|
oldnew = append(oldnew, v, "***")
|
||||||
}
|
}
|
||||||
|
if v := task.Context.Fields["gitea_runtime_token"].GetStringValue(); v != "" {
|
||||||
|
oldnew = append(oldnew, v, "***")
|
||||||
|
}
|
||||||
for _, v := range task.Secrets {
|
for _, v := range task.Secrets {
|
||||||
oldnew = append(oldnew, v, "***")
|
oldnew = append(oldnew, v, "***")
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user