I use VS code. I am starting a new project that is using GitHub Actions. I am using Red Hat's YAML extension.
It usually works great. It says that is has support for GitHub Workflows and GitHub Actions. But it is very "confused" regarding what should be highlighted. The code in the screenshot below works - I have deployed successfully - and it is messing up very obvious highlighting. In the screenshot, I am hovering over elements in the env
list and you can see that it is saying that environment variables must be booleans. (FWIW, I also tried putting in a boolean and then it complained about it not being a key-value pair, which is actually correct.)
It appears that others are also having this problem and there was a suggestion given here that should have fixed it but didn't.
Has anyone else had trouble setting up GitHub Actions syntax highlighting?
For anyone else who finds their way here, this is, apparently, intended behavior. Adding support for Actions isn't on GitHub's roadmap for the plugin at the time of writing.
As a workaround, you can manually set the language mode to GitHub Actions Workflow
which will at least get you syntax highlighting. It won't get you autocomplete, though.
After spending a few weeks working a lot with Actions and Workflows I would not recommend using Workflow syntax when writing composite
actions. The syntax between the two is subtly different, and you're likely to make mistakes if you use the wrong highlighter.
For example, if Intellisense thinks you're working on a Workflow, it won't be able to tell you that jobs
, env
, and secrets
are invalid keys on an Action.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With