-
Notifications
You must be signed in to change notification settings - Fork 110
There is no formatter for 'github-actions-workflow' #195
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
Comments
I think a formatter would be great. I also think its a pretty big reach from where we are now. I think for there to be any chance of this card getting worked on, we need a much clearer idea of the scope of work. I'm going to leave it open for now while we mull it over, but its more likely to get traction if we had a better idea of what it would imply |
Can we just call an installed YAML formatter until there's a specific formatter for actions workflows? |
@sparr that is a great idea and it's is how I am working around it, by switching betweeen the file type recognition in vscode. I would love to be able to configure the file association of a GitHub action file with a yaml formatter, that should be a heavy lift. @felipesu19 what are your thought? |
I installed the redhat yaml extension and this uses various schemas from here: This gives formatting for GHA yaml files - I see this in the GHAs files (including for action.yaml files - see the second image). This is using the following schemas: https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/github-workflow.json I do not use the "official" GitHub Actions extension anymore as it is quite buggy (ie, red underlined text showing issues when there are none) and has no formatter. And it does not work on action.yaml files. However, I keep an eye on it to see if it has improved, as I do like the way it colours the text and the things that do work are great. If the GitHub Actions extension could make use of https://github.com/SchemaStore/schemastore then it'd be much more useful. BTW - I also have this set in my vscode settings:
I did try just setting that without installing the redhat yaml extension, but it didn't work from what I remember. I had to have the redhat yaml extension installed as well. The settings config is not strictly necessary, but I did find a few files were not picked up as GHA workflow files, but this settings config seems to make them all get picked up. |
This. Is it not possible to call Prettier or the configured YAML formatter? |
We'd need to expose a configuration that allowed the user to point at a YAML formatter. Not impossible but does require some UI work and may run into issues depending on what formatter people want to use. |
Related on Stack Overflow: There is no formatter for 'github-actions-workflow' files installed. @felipesu19, why doesn't is work to just honour something like this?: "[github-actions-workflow]": {
"editor.defaultFormatter": "redhat.vscode-yaml"
}, |
@felipesu19 Would you support a vscode feature request such that you could just name one or more fallback languages, so you only need to say "treat this file like |
My current workflow involves moving the workflow .yml files out of the workflows directory, formatting them, and returning them. This process is very painful. |
Any intention in officially support this feature and not require workarounds by the end user? Thanks |
By the way, it has been raised a feature request to the RedHat YAML Extension to allow association with the 'github-actions-workflow' type: redhat-developer/vscode-yaml#1086 |
Still a need for this |
Good that the issue is not a decade old. Surprised it exists. |
Describe the bug

A clear and concise description of what the bug is.
Expected behavior
I would expect formatting to 'just work' and also to have documentation about how to configure it
Extension Version
v0.25.7
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: