mirror of
https://gitea.com/gitea/runner.git
synced 2026-11-12 02:44:10 +00:00
fix: keep a step's own with: values out of its inputs context (#1192)
A step's `if:`, its `continue-on-error:` and its `run:` script resolved `inputs.*` from the step's own `INPUT_*` env. A `with:` key colliding with a workflow input flipped conditions, and any `INPUT_`-shaped variable from `env:` or a `GITHUB_ENV` write forged an input that never existed. GitHub evaluates all three in the enclosing scope: the workflow inputs, or for a composite action's steps that action's inputs. Action-input interpolation is the one place that legitimately sees a step's own `with:`, so it keeps its own evaluator. Fixes https://gitea.com/gitea/runner/issues/1191, ports https://github.com/nektos/act/pull/2473 and extends it to the pre and post stages. --------- Co-authored-by: silverwind <[email protected]> Reviewed-on: https://gitea.com/gitea/runner/pulls/1192 Reviewed-by: silverwind <[email protected]> Co-authored-by: ABiscuitttt <[email protected]>
This commit is contained in:
1 parent
0712b2a7a1
commit
212909db7b
10 files changed
+81
-23
No files matched your search
@@ -992,6 +992,14 @@ func TestRunContextGetEnv(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// a remote composite action re-evaluates its env per stage, so inputs must follow it
|
||||
func TestSetActionEnvRefreshesInputs(t *testing.T) {
|
||||
rc := &RunContext{}
|
||||
rc.setActionEnv(map[string]string{"INPUT_MSG": "pre"})
|
||||
rc.setActionEnv(map[string]string{"INPUT_MSG": "main"})
|
||||
assert.Equal(t, map[string]any{"msg": "main"}, rc.actionInputs)
|
||||
}
|
||||
|
||||
func TestCreateContainerNameBoundedForLongMatrixInput(t *testing.T) {
|
||||
longMatrixValue := strings.Repeat("os=ubuntu-latest-go=1.24-node=22-", 20)
|
||||
name := createContainerName(
|
||||
|
||||
Reference in new issue
Block a user