Inject version when building and report version to Gitea via log and header (#43)
close #42 1. Inject runner version when `make build` After building, executing command line: `./act_runner -v` or `./act_runner --version`, the version of runner is printed.  2. In `Actions` UI:  3. Set request header in http client interceptor. Co-authored-by: sillyguodong <gedong_1994@163.com> Reviewed-on: https://gitea.com/gitea/act_runner/pulls/43 Reviewed-by: delvh <dev.lh@web.de> Reviewed-by: Jason Song <i@wolfogre.com> Co-authored-by: sillyguodong <sillyguodong@noreply.gitea.io> Co-committed-by: sillyguodong <sillyguodong@noreply.gitea.io>
This commit is contained in:
parent
b202c62bf7
commit
0445675a10
8 changed files with 22 additions and 11 deletions
|
@ -12,6 +12,7 @@ import (
|
|||
// Runner runs the pipeline.
|
||||
type Runner struct {
|
||||
Machine string
|
||||
Version string
|
||||
ForgeInstance string
|
||||
Environ map[string]string
|
||||
Client client.Client
|
||||
|
@ -26,7 +27,7 @@ func (s *Runner) Run(ctx context.Context, task *runnerv1.Task) error {
|
|||
env[k] = v
|
||||
}
|
||||
env["ACTIONS_CACHE_URL"] = s.CacheHandler.ExternalURL() + "/"
|
||||
return NewTask(s.ForgeInstance, task.Id, s.Client, env, s.platformPicker).Run(ctx, task, s.Machine)
|
||||
return NewTask(s.ForgeInstance, task.Id, s.Client, env, s.platformPicker).Run(ctx, task, s.Machine, s.Version)
|
||||
}
|
||||
|
||||
func (s *Runner) platformPicker(labels []string) string {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue