Restore GitHub action output schema dispatch - #6308
Merged
madskristensen merged 2 commits intoSep 4, 2026
Merged
Conversation
Each fixture was added individually on top of master, then tested with:
node ./cli.js check --schema-name=github-action.json
`outputs-empty.json`:
>> Failed to validate file "src/test/github-action/outputs-empty.json" against schema file "./src/schemas/json/github-action.json"
>> Showing first error out of 1 total error(s)
{
instancePath: '/outputs',
schemaPath: '#/properties/outputs/oneOf',
keyword: 'oneOf',
params: { passingSchemas: [ 0, 1 ] },
message: 'must match exactly one schema in oneOf'
}
`output-id-runs.json`:
>> Failed to validate file "src/test/github-action/output-id-runs.json" against schema file "./src/schemas/json/github-action.json"
>> Showing first error out of 3 total error(s)
{
instancePath: '/outputs',
schemaPath: '#/definitions/outputs-composite/dependencies/runs/required',
keyword: 'required',
params: { missingProperty: 'using' },
message: "must have required property 'using'"
}
`javascript-output-with-value.json`:
>> Schema validation succeeded for test file "./src/negative_test/github-action/javascript-output-with-value.json", but was supposed to fail
>> For schema "./src/schemas/json/github-action.json"
`composite-output-missing-value.json`:
>> Schema validation succeeded for test file "./src/negative_test/github-action/composite-output-missing-value.json", but was supposed to fail
>> For schema "./src/schemas/json/github-action.json"
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The strict-validation rewrite moved runtime-dependent output selection into `dependencies` nested under each output definition. At that level, `runs` means an output identifier rather than the top-level action runtime, so the schema cannot distinguish composite outputs from JavaScript or Docker outputs. Restore top-level `if` / `then` / `else` dispatch based on `runs.using`. Keep the placeholder `outputs` property required by draft-07 `additionalProperties: false`, and declare the nested `runs` condition as an object so AJV strict type validation still passes. This makes empty output maps and output IDs named `runs` valid again, rejects JavaScript outputs containing composite-only `value`, and requires `value` for composite outputs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
TWiStErRob
marked this pull request as ready for review
September 4, 2026 18:13
TWiStErRob
requested review from
hyperupcall and
madskristensen
as code owners
September 4, 2026 18:13
Contributor
|
Thanks for the PR! This section of the codebase is owned by @madskristensen and |
Contributor
Author
|
@Vessel9817 please take a look in case the fixes are incorrect. |
Contributor
|
Thanks! |
Contributor
|
Not familiar with using composite actions, but LGTM |
Contributor
|
Sorry @Vessel9817, you don't have access to these files: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Restore runtime-dependent validation for action outputs after #6270 moved the discriminator into output definitions, where
runsrefers to an output identifier rather than the top-level action runtime.Cause
#6270 replaced top-level
if/then/elsedispatch withdependenciesnested inside each output definition. Dependencies evaluate the current output map, sorunsis interpreted as an output identifier and cannot inspect top-levelruns.using. The remaining undiscriminatedoneOfallows the standard and composite output schemas to overlap.The first commit adds four regression fixtures and records the verbatim failures produced when each fixture is tested independently on
master. The second commit restores top-levelif/then/elsedispatch based onruns.using, with the object type required by AJV strict validation.This restores these behaviors:
runsis a valid output identifier.value.value.AI-generated (GPT-5.6 Sol), session: 735ab2c3-5ca6-4a29-815a-614392508b98 in schemastore.