Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"description": "Composite action with an output missing its value",
"name": "Test composite output without value",
"outputs": {
"result": {
"description": "Missing value"
}
},
"runs": {
"steps": [
{
"run": "echo test",
"shell": "bash"
}
],
"using": "composite"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"description": "JavaScript action with a composite-only output value",
"name": "Test JavaScript output with value",
"outputs": {
"result": {
"description": "Unexpected value",
"value": "${{ steps.test.outputs.result }}"
}
},
"runs": {
"main": "index.js",
"using": "node24"
}
}
59 changes: 27 additions & 32 deletions src/schemas/json/github-action.json
Original file line number Diff line number Diff line change
Expand Up @@ -300,20 +300,7 @@
"additionalProperties": false
}
},
"additionalProperties": false,
"dependencies": {
"runs": {
"type": "object",
"properties": {
"using": {
"not": {
"const": "composite"
}
}
},
"required": ["using"]
}
}
"additionalProperties": false
},
"outputs-composite": {
"$comment": "https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#outputs-for-composite-actions",
Expand All @@ -340,16 +327,24 @@
"additionalProperties": false
}
},
"additionalProperties": false,
"dependencies": {
"runs": {
"type": "object",
"properties": {
"using": {
"const": "composite"
}
},
"required": ["using"]
"additionalProperties": false
}
},
"else": {
"properties": {
"outputs": {
"$ref": "#/definitions/outputs"
}
}
},
"if": {
"properties": {
"runs": {
"type": "object",
"properties": {
"using": {
"const": "composite"
}
}
}
}
Expand Down Expand Up @@ -407,14 +402,7 @@
"additionalProperties": false
},
"outputs": {
"oneOf": [
{
"$ref": "#/definitions/outputs-composite"
},
{
"$ref": "#/definitions/outputs"
}
]
"$comment": "Because of `additionalProperties: false`, this empty schema is needed to allow the `outputs` property. The `outputs` subschema is determined by the if/then/else keywords."
},
"runs": {
"oneOf": [
Expand Down Expand Up @@ -719,5 +707,12 @@
}
},
"required": ["name", "description", "runs"],
"then": {
"properties": {
"outputs": {
"$ref": "#/definitions/outputs-composite"
}
}
},
"type": "object"
}
13 changes: 13 additions & 0 deletions src/test/github-action/output-id-runs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"description": "JavaScript action with an output named runs",
"name": "Test output named runs",
"outputs": {
"runs": {
"description": "An output whose identifier matches a top-level property"
}
},
"runs": {
"main": "index.js",
"using": "node24"
}
}
9 changes: 9 additions & 0 deletions src/test/github-action/outputs-empty.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"description": "JavaScript action with an empty output map",
"name": "Test empty outputs",
"outputs": {},
"runs": {
"main": "index.js",
"using": "node24"
}
}
Loading