-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build time throw for Github Workflow schema #158
Comments
There is an option to silence schema mistakes: https://github.com/ExodusMovement/schemasafe/blob/master/doc/Options.md#options-for-relaxing-coherence-checks
|
Ah. Upon a closer look, the mistake in the schema is a significant one! Consider the following parts of the schema you provided: "$schema": "http://json-schema.org/draft-07/schema#", "branch_protection_rule": {
"$comment": "https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows#branch_protection_rule",
"$ref": "#/definitions/eventObject",
"description": "Runs your workflow anytime the branch_protection_rule event occurs. More than one activity type triggers this event.",
"properties": {
"types": {
"$ref": "#/definitions/types",
"items": {
"type": "string",
"enum": ["created", "edited", "deleted"]
},
"default": ["created", "edited", "deleted"]
}
} But in draft-07, unlike later ones, Upstream testsuite: https://github.com/json-schema-org/JSON-Schema-Test-Suite/blob/8cdfac41e37527795879e480a483997cbd6188f3/tests/draft7/ref.json#L145-L177 |
The proper fix is to update the schema version to |
@Aplietexe I reported this bug here: SchemaStore/schemastore#3102 |
Closing as answered, this is a problem with schemastore schemas being incorrect (though technically valid, but not doing what they are intended to do). This check can be silenced via options, but I wouldn't recommend that -- a proper way would be to actually fix the schema. |
A separate linter mode is introduced in 1.1.0/1.1.1 |
When trying to use the GitHub Workflow schema from schemastore, an error is thrown at build time:
Perhaps it is because
"properties"
is present althoughbranch_protection_rule
is either an object or null. In any case, that is fine according to the metaschema, and seems to be a common practice to reduce duplication.Example:
schema.js
simplyexport default
s the schema from the link.The text was updated successfully, but these errors were encountered: