mirror of
https://code.forgejo.org/forgejo/runner.git
synced 2024-11-21 20:27:17 +03:00
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>
This commit is contained in:
parent
8c14933e70
commit
b0bd503b11
1 changed files with 6 additions and 0 deletions
|
@ -416,6 +416,12 @@ func runExec(ctx context.Context, execArgs *executeArgs) func(cmd *cobra.Command
|
||||||
|
|
||||||
config.Env["ACT_EXEC"] = "true"
|
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 {
|
if !execArgs.debug {
|
||||||
logLevel := log.Level(log.InfoLevel)
|
logLevel := log.Level(log.InfoLevel)
|
||||||
config.JobLoggerLevel = &logLevel
|
config.JobLoggerLevel = &logLevel
|
||||||
|
|
Loading…
Reference in a new issue