From 660e24bff57b8c306c3b23510a4002d3a456edec Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Wed, 30 Jul 2025 11:06:55 +0000 Subject: [PATCH] fix: the vars context is allowed in an action step env (#761) the actions schema validation must not fail when using an expression such as: ```yaml runs: using: composite steps: - name: Build the container image for each architecture env: BUILDKIT_HOST: ${{ vars.BUILDKIT_HOST }} run: buildkit-build.sh ``` --- Without the fix, the test fails with: ``` go test -run=TestActionSchema -v ./act/schema === RUN TestActionSchema schema_test.go:153: Error Trace: /home/earl-warren/software/runner/act/schema/schema_test.go:153 Error: Received unexpected error: Line: 14 Column 3: Failed to match container-runs: Line: 15 Column 3: Unknown Property steps Line: 14 Column 3: Failed to match node-runs: Line: 15 Column 3: Unknown Property steps Line: 14 Column 3: Failed to match plugin-runs: Line: 14 Column 3: Unknown Property using Line: 15 Column 3: Unknown Property steps Line: 14 Column 3: Failed to match composite-runs: Line: 16 Column 7: Failed to match run-step: Line: 19 Column 18: Unknown Variable Access vars Line: 16 Column 7: Failed to match uses-step: Line: 16 Column 7: Unknown Property run Line: 19 Column 18: Unknown Variable Access vars Test: TestActionSchema --- FAIL: TestActionSchema (0.00s) FAIL FAIL code.forgejo.org/forgejo/runner/act/schema 0.003s FAIL ``` --- - bug fixes - [PR](https://code.forgejo.org/forgejo/runner/pulls/761): fix: the vars context is allowed in an action step env Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/761 Reviewed-by: Michael Kriese Co-authored-by: Earl Warren Co-committed-by: Earl Warren --- act/schema/action_schema.json | 1 + act/schema/schema_test.go | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/act/schema/action_schema.json b/act/schema/action_schema.json index 3b2ebdfe..9b1ac8dd 100644 --- a/act/schema/action_schema.json +++ b/act/schema/action_schema.json @@ -220,6 +220,7 @@ "steps", "job", "runner", + "vars", "env", "hashFiles(1,255)" ], diff --git a/act/schema/schema_test.go b/act/schema/schema_test.go index b9fd64e6..6c3b1a8b 100644 --- a/act/schema/schema_test.go +++ b/act/schema/schema_test.go @@ -139,7 +139,10 @@ inputs: runs: using: "composite" steps: - - run: echo "${{ github.action_path }}" + - run: | + echo "${{ github.action_path }}" + env: + MYVAR: ${{ vars.VARIABLE }} `), &node) if !assert.NoError(t, err) { return