mirror of
https://code.forgejo.org/forgejo/runner.git
synced 2025-09-15 18:57:01 +00:00
feat: add forgejo_default_actions_url + forgejo_runtime_token
the context sent from the Forgejo instance is expected to have gitea_default_actions_url gitea_runtime_token add support for forgejo_default_actions_url forgejo_runtime_token as well so that future Forgejo versions can make the change.
This commit is contained in:
parent
42cacd47c2
commit
8cb450ffe0
3 changed files with 31 additions and 9 deletions
|
@ -43,12 +43,12 @@ type Reporter struct {
|
|||
stopCommandEndToken string
|
||||
}
|
||||
|
||||
func NewReporter(ctx context.Context, cancel context.CancelFunc, client client.Client, task *runnerv1.Task, reportInterval time.Duration) *Reporter {
|
||||
func NewReporter(ctx context.Context, cancel context.CancelFunc, c client.Client, task *runnerv1.Task, reportInterval time.Duration) *Reporter {
|
||||
var oldnew []string
|
||||
if v := task.Context.Fields["token"].GetStringValue(); v != "" {
|
||||
oldnew = append(oldnew, v, "***")
|
||||
}
|
||||
if v := task.Context.Fields["gitea_runtime_token"].GetStringValue(); v != "" {
|
||||
if v := client.BackwardCompatibleContext(task, "runtime_token"); v != "" {
|
||||
oldnew = append(oldnew, v, "***")
|
||||
}
|
||||
for _, v := range task.Secrets {
|
||||
|
@ -58,7 +58,7 @@ func NewReporter(ctx context.Context, cancel context.CancelFunc, client client.C
|
|||
rv := &Reporter{
|
||||
ctx: ctx,
|
||||
cancel: cancel,
|
||||
client: client,
|
||||
client: c,
|
||||
oldnew: oldnew,
|
||||
reportInterval: reportInterval,
|
||||
logReplacer: strings.NewReplacer(oldnew...),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue