-
Notifications
You must be signed in to change notification settings - Fork 221
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
Uses the wrong schema, even when yaml.schemas is set #397
Uses the wrong schema, even when yaml.schemas is set #397
Comments
Looks like it is related to redhat-developer/yaml-language-server#250 |
I'm experiencing the same issue. Slightly related, initially the plugin keeps guessing the wrong schema to apply. But then overwriting its guess with a setting as described in this issue does not work. |
Same issue with
Want to highlight (from linked issue) that disabling schema store can work around this issue. |
Having the same problem, with any github workflow file named '*deploy*'. I'm unable to set the schema with: "yaml.schemas": {
"https://json.schemastore.org/github-workflow": "/.githhub/workflows/**/*.yml"
} |
It looks like |
@JPinkney good spot! Unfortunately it makes no difference, it's still using the [edit] good to know a fix is coming! |
FYI @JPinkney I still have issues for some templates What is weird is that the descriptions are fine, but it still gives an error on the validation. |
I'm having a similar issue with GitLab CI configuration file, which contains EDIT: It would be preferred if |
Interestingly enough, this issue only happens if the action is named |
I solved problem by renaming file to Thanks for help! |
@evidolob with the fixed version of yaml-language-server installed, this issue is not resolved. Files named |
Then we need to get redhat-developer/yaml-language-server#427 merged to fix all issues with file match |
Any luck on this? I just ran into it creating a github workflow called |
Will there be a release anytime soon? I'm seeing the issue in v0.19.2 in a fresh vscode install. Or is there an easy way to patch this in place? |
@czmola I've used the following work-around: add the following line on top of the yaml file that fails (usually one with # yaml-language-server: $schema=https://json.schemastore.org/ansible-playbook.json That should do the trick until it's fixed 😎 |
or the |
@fastlorenzo
|
Any news on this? I'm experiencing the same issue |
@bermann Are you using latest version if vscode-yaml? |
I had the same issue but with another schema. The issue was solved by adding this at the top:
This was the schema that my other yaml file were using. |
I'm having the same problem with a file called VSCode: 1.58.2 |
For those who don't know how to set the schema settings with: "yaml.schemas": {
"https://json.schemastore.org/github-workflow": "/.github/workflows/**/*.yml"
} Simply press Ctrl+, in visual code > Extentions > Yaml > Edit in settings.json right after Yaml: completion |
* feat: add multiple schema deletions * fix: typing MODIFICATION_ACTIONS.deleteAll Co-authored-by: Petr Spacek <[email protected]>
This seems like exactly what I should need, since the proper schema was not being found. But I tried it and it did not help. I then double checked json.schemastore.org/github-workflow and it says that it should work, but it still doesn't. The relevant snippet: "env": {
"$comment": "https://docs.github.com/en/actions/learn-github-actions/environment-variables",
"description": "To set custom environment variables, you need to specify the variables in the workflow file. You can define environment variables for a step, job, or entire workflow using the jobs.<job_id>.steps[*].env, jobs.<job_id>.env, and env keywords. For more information, see https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#jobsjob_idstepsenv",
"oneOf": [
{
"type": "object",
"additionalProperties": {
"oneOf": [
{
"type": "string"
},
{
"type": "number"
},
{
"type": "boolean"
}
]
},
"minProperties": 1
},
{
"$ref": "#/definitions/expressionSyntax",
"$comment": "https://docs.github.com/en/actions/learn-github-actions/expressions#fromjson",
"pattern": "^\\$\\{\\{\\s*fromJSON\\(.*\\)\\s*\\}\\}$"
}
]
}, I'm not sure what I'm doing wrong. Is no one else having this syntax highlighting problem? For now, I have just turned it off via: "files.associations": {
"/.github/workflows/**/*.yml": "plaintext"
}, in my |
@lazarillo it looks like the latest version has introduced some issues with how it interprets the GitHub Workflow schema: #691. |
This work for me, thanks for tip. @bobba76 |
I also experience strange behavior on Windows with VS Code 1.67.2 and redhat.vscode-yaml 1.8.0. A file |
@piotr-cz for Ansible, it's using this now https://raw.githubusercontent.com/ansible-community/schemas/main/f/ansible.json
|
Describe the bug
I'm using this extension and the GitHub Actions YAML extension. The last three error messages (using the proper schema) are from that other extension. The erroneous errors above them are from this extension. Disabling the GitHub Actions extension makes those last three (correct, proper) errors disappear, leaving the false errors this extension is reporting.
The problem: this extension thinks my GitHub Actions workflow file is a "deploy php" file and so uses the wrong schema... simply because it has the word "deploy" in its file name. Change the name to
build-test-deplox.yml
and everything works. I can't make this extension ignore YAML files and I can't force this extension to use the correct schema (on the right, you can see theyaml.schemas
setting being completely ignored).Unfortunately for my
.github/dependabot.yml
file, I've had to disable this extension for now. Am I doing something wrong here?Expected Behavior
Use https://json.schemastore.org/github-workflow for
build-test-deploy.yml
like I told it toCurrent Behavior
Uses https://raw.githubusercontent.com/deployphp/deployer/master/src/schema.json instead
Steps to Reproduce
.github/workflows/build-test-deploy.yml
file in your projectBonus: replace "https://json.schemastore.org/github-workflow" with "https://json.schemastore.org/github-workflowfdsfdsff"
in
yaml.schemas
and the extension recognizes that the schema does not exist, so it is receiving the proper schema fromsettings.json
!Environment
The text was updated successfully, but these errors were encountered: