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
18
internal/pkg/client/backward.go
Normal file
18
internal/pkg/client/backward.go
Normal file
|
@ -0,0 +1,18 @@
|
|||
// Copyright 2025 The Forgejo Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package client
|
||||
|
||||
import (
|
||||
runnerv1 "code.gitea.io/actions-proto-go/runner/v1"
|
||||
)
|
||||
|
||||
func BackwardCompatibleContext(task *runnerv1.Task, suffix string) string {
|
||||
for _, prefix := range []string{"forgejo_", "gitea_"} {
|
||||
value := task.Context.Fields[prefix+suffix]
|
||||
if value != nil {
|
||||
return value.GetStringValue()
|
||||
}
|
||||
}
|
||||
return ""
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue