1
0
Fork 0
mirror of https://code.forgejo.org/forgejo/runner.git synced 2025-09-15 18:57:01 +00:00

Don't interpolate joboutputs, before job is done (#894)

* Don't interpolate joboutputs, before job is donei

All credits go to @ChristopherHX which fixed this issue.
I only created a PR for this so it will be fixed in the upstream binary.

This fixes #758

* Added output test

* Fix typo
This commit is contained in:
Mathijs van Veluw 2021-11-24 16:49:08 +01:00 committed by GitHub
parent 20cdc7d0ff
commit 65eea13a0b
4 changed files with 60 additions and 15 deletions

View file

@ -39,19 +39,6 @@ func (sc *StepContext) execJobContainer() common.Executor {
}
}
func (sc *StepContext) interpolateOutputs() common.Executor {
return func(ctx context.Context) error {
ee := sc.NewExpressionEvaluator()
for k, v := range sc.RunContext.Run.Job().Outputs {
interpolated := ee.Interpolate(v)
if v != interpolated {
sc.RunContext.Run.Job().Outputs[k] = interpolated
}
}
return nil
}
}
type formatError string
func (e formatError) Error() string {