feat: add artifact api from gitea server #103

Merged
fuxiaohei merged 2 commits from main into main 2023-04-10 13:35:08 +00:00
+8
View File
@@ -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