Patched options() to let container options propagate to job containers (#80)

This PR let "general" container config to be propagated to each job container.

See:
- https://gitea.com/gitea/act_runner/issues/265#issuecomment-744382
- https://gitea.com/gitea/act_runner/issues/79
- https://gitea.com/gitea/act_runner/issues/378

Reviewed-on: https://gitea.com/gitea/act/pulls/80
Reviewed-by: Jason Song <i@wolfogre.com>
Co-authored-by: Claudio Nicora <claudio.nicora@gmail.com>
Co-committed-by: Claudio Nicora <claudio.nicora@gmail.com>
This commit is contained in:
Claudio Nicora 2024-03-04 02:56:52 +00:00 committed by Jason Song
parent 82a3640cf8
commit 7e20ddf928

View file

@ -717,7 +717,7 @@ func (rc *RunContext) options(ctx context.Context) string {
job := rc.Run.Job() job := rc.Run.Job()
c := job.Container() c := job.Container()
if c != nil { if c != nil {
return rc.ExprEval.Interpolate(ctx, c.Options) return rc.Config.ContainerOptions + " " + rc.ExprEval.Interpolate(ctx, c.Options)
} }
return rc.Config.ContainerOptions return rc.Config.ContainerOptions