mirror of https://code.forgejo.org/forgejo/runner
add token support for exec (#247)
allow to pass token from secrets Reviewed-on: https://gitea.com/gitea/act_runner/pulls/247 Reviewed-by: Jason Song <i@wolfogre.com> Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: Tomasz Duda <tomaszduda23@gmail.com> Co-committed-by: Tomasz Duda <tomaszduda23@gmail.com>pull/41/head
parent
8c14933e70
commit
b0bd503b11
|
@ -416,6 +416,12 @@ func runExec(ctx context.Context, execArgs *executeArgs) func(cmd *cobra.Command
|
|||
|
||||
config.Env["ACT_EXEC"] = "true"
|
||||
|
||||
if t := config.Secrets["GITEA_TOKEN"]; t != "" {
|
||||
config.Token = t
|
||||
} else if t := config.Secrets["GITHUB_TOKEN"]; t != "" {
|
||||
config.Token = t
|
||||
}
|
||||
|
||||
if !execArgs.debug {
|
||||
logLevel := log.Level(log.InfoLevel)
|
||||
config.JobLoggerLevel = &logLevel
|
||||
|
|
Loading…
Reference in New Issue