diff --git a/internal/app/run/runner.go b/internal/app/run/runner.go index 6e31373..1d9c91a 100644 --- a/internal/app/run/runner.go +++ b/internal/app/run/runner.go @@ -9,6 +9,7 @@ import ( "encoding/json" "fmt" "path/filepath" + "strings" "sync" "time" @@ -60,6 +61,10 @@ func NewRunner(cfg *config.Config, reg *config.Registration, cli client.Client) } } + // set artifact gitea api + artifactGiteaAPI := strings.TrimSuffix(cli.Address(), "/") + "/api/actions_pipeline/" + envs["ACTIONS_RUNTIME_URL"] = artifactGiteaAPI + return &Runner{ name: reg.Name, cfg: cfg, @@ -149,6 +154,9 @@ func (r *Runner) run(ctx context.Context, task *runnerv1.Task, reporter *report. preset.Token = t } + // use task token to action api token + r.envs["ACTIONS_RUNTIME_TOKEN"] = preset.Token + eventJSON, err := json.Marshal(preset.Event) if err != nil { return err