Member-only story

How to automatically detect issues in your YAML file with GitHub Actions

Xavier Jouvenot
2 min readFeb 23, 2022

--

Hello ! I’m Xavier Jouvenot and in this small post, I am going to explain how to automatically detect issues in your YAML file with GitHub Actions.

Self promotion: You can find other articles on computer science and programming on my website 😉

Problematic

If you have CI/CD processes or if you want to create some for your project, and you have some YAML files versioned, then it may be important to make sure that they are always properly written and don’t contain any error due to indentation mistake, for example.

Moreover, having an automatic process to approve the YAML will enhance the quality of your project and facilitate the contribution from other developers from your team, or even external collaborators, since they would have direct information from the CI about the issues in the YAML files.

Solution

The short answer, for the people who don’t want to read through the entire article (I know you do that! I do it too 😆) is to insert the following steps in your GitHub Action process:

steps:
- name: Installs the latest version of Yamllint
run: pip install yamllint
- name: Runs yamllint on all the yaml file of the repository
run: yamllint --strict .

If you have my previous article about “How to easily detect issues in your YAML files”, you may already know about about the tool named…

--

--

No responses yet