runner/act/schema/action_schema.json

282 lines
5.9 KiB
JSON
Raw Normal View History

{
"definitions": {
"action-root": {
"description": "Action file",
"mapping": {
"properties": {
"name": "string",
"description": "string",
"inputs": "inputs",
"runs": "runs",
"outputs": "outputs"
},
"loose-key-type": "non-empty-string",
"loose-value-type": "any"
}
},
"inputs": {
"one-of": ["null", "inputs-mapping"]
},
"inputs-mapping": {
"mapping": {
"loose-key-type": "non-empty-string",
"loose-value-type": "input"
}
},
"input": {
"one-of": ["null", "input-mapping"]
},
"input-mapping": {
"mapping": {
"properties": {
"default": "input-default-context"
},
"loose-key-type": "non-empty-string",
"loose-value-type": "any"
}
},
"outputs": {
"mapping": {
"loose-key-type": "non-empty-string",
"loose-value-type": "output-definition"
}
},
"output-definition": {
"mapping": {
"properties": {
"description": "string",
"value": "output-value"
}
}
},
"runs": {
"one-of": ["container-runs", "node-runs", "plugin-runs", "composite-runs"]
},
"container-runs": {
"mapping": {
"properties": {
"using": "non-empty-string",
"image": "non-empty-string",
"entrypoint": "non-empty-string",
"args": "container-runs-args",
"env": "container-runs-env",
"pre-entrypoint": "non-empty-string",
"pre-if": "non-empty-string",
"post-entrypoint": "non-empty-string",
"post-if": "non-empty-string"
}
}
},
"container-runs-args": {
"sequence": {
"item-type": "container-runs-context"
}
},
"container-runs-env": {
"context": ["inputs"],
"mapping": {
"loose-key-type": "non-empty-string",
"loose-value-type": "string"
}
},
"node-runs": {
"mapping": {
"properties": {
"using": "non-empty-string",
"main": "non-empty-string",
"pre": "non-empty-string",
"pre-if": "non-empty-string",
"post": "non-empty-string",
"post-if": "non-empty-string"
}
}
},
"plugin-runs": {
"mapping": {
"properties": {
"plugin": "non-empty-string"
}
}
},
"composite-runs": {
"mapping": {
"properties": {
"using": "non-empty-string",
"steps": "composite-steps"
}
}
},
"composite-steps": {
"sequence": {
"item-type": "composite-step"
}
},
"composite-step": {
"one-of": ["run-step", "uses-step"]
},
"run-step": {
"mapping": {
"properties": {
"name": "string-steps-context",
"id": "non-empty-string",
"if": "step-if",
"run": {
"type": "string-steps-context",
"required": true
},
"env": "step-env",
"continue-on-error": "boolean-steps-context",
"working-directory": "string-steps-context",
"shell": {
"type": "string-steps-context",
"required": true
}
}
}
},
"uses-step": {
"mapping": {
"properties": {
"name": "string-steps-context",
"id": "non-empty-string",
"if": "step-if",
"uses": {
"type": "non-empty-string",
"required": true
},
"continue-on-error": "boolean-steps-context",
"with": "step-with",
"env": "step-env"
}
}
},
"container-runs-context": {
"context": ["inputs"],
"string": {}
},
"output-value": {
"context": [
"forge",
"github",
"strategy",
"matrix",
"steps",
"inputs",
"job",
"runner",
"env"
],
"string": {}
},
"input-default-context": {
"context": [
"forge",
"github",
"env",
"strategy",
"matrix",
"job",
"runner",
"vars",
"hashFiles(1,255)"
],
"string": {}
},
"non-empty-string": {
"string": {
"require-non-empty": true
}
},
"string-steps-context": {
"context": [
"forge",
"github",
"inputs",
"strategy",
"matrix",
"steps",
"job",
"runner",
"vars",
"env",
"hashFiles(1,255)"
],
"string": {}
},
"boolean-steps-context": {
"context": [
"forge",
"github",
"inputs",
"strategy",
"matrix",
"steps",
"job",
"runner",
"vars",
"env",
"hashFiles(1,255)"
],
"boolean": {}
},
"step-env": {
"context": [
"forge",
"github",
"inputs",
"strategy",
"matrix",
"steps",
"job",
"runner",
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 ``` --- <!--start release-notes-assistant--> <!--URL:https://code.forgejo.org/forgejo/runner--> - bug fixes - [PR](https://code.forgejo.org/forgejo/runner/pulls/761): <!--number 761 --><!--line 0 --><!--description Zml4OiB0aGUgdmFycyBjb250ZXh0IGlzIGFsbG93ZWQgaW4gYW4gYWN0aW9uIHN0ZXAgZW52-->fix: the vars context is allowed in an action step env<!--description--> <!--end release-notes-assistant--> Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/761 Reviewed-by: Michael Kriese <michael.kriese@gmx.de> Co-authored-by: Earl Warren <contact@earl-warren.org> Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-07-30 11:06:55 +00:00
"vars",
"env",
"hashFiles(1,255)"
],
"mapping": {
"loose-key-type": "non-empty-string",
"loose-value-type": "string"
}
},
"step-if": {
"context": [
"forge",
"github",
"inputs",
"strategy",
"matrix",
"steps",
"job",
"runner",
"vars",
"env",
"always(0,0)",
"failure(0,0)",
"cancelled(0,0)",
"success(0,0)",
"hashFiles(1,255)"
],
"string": {}
},
"step-with": {
"context": [
"forge",
"github",
"inputs",
"strategy",
"matrix",
"steps",
"job",
"runner",
"vars",
"env",
"hashFiles(1,255)"
],
"mapping": {
"loose-key-type": "non-empty-string",
"loose-value-type": "string"
}
}
}
}