Then, both DEV and OPS started to migrate source codes.
It appeared that OPS had to migrate a huge amount of Ansible related repos from an onPrem Gitlab instance to Github.com, and we wanted to take advantage of linting and code quality of the yamls.
OPS started to develop the migration process so it could be entirely code driven and tested.
What appeared was that we needed to manage that huge amount of code to :
1๏ธโฃ lint (syntax validity, but for weirdnesses like key repetition and cosmetic problems such as lines length, trailing spaces, indentation, etc)
2๏ธโฃ fix/implement lints feedbacks in a massive way (they were so huge that we could not imagine do that by hand)
Here is the code (and... it's yaml ๐๐ฅ๐ฃ) required to use the action in any workflow :
name:Lint yaml fileson:[push]jobs:lint:runs-on:ubuntu-lateststeps:-name:Checkout my appuses:actions/checkout@v2-name:Lint yaml filesuses:opt-nc/yamlfixer-actionwith:yaml_file:.github/*.ymloptions:--verboseuser:${{secrets.my_user}}token:${{secrets.my_user_password}}
๐ Notice that the action creates a new branch and the pull request to be merged into the working branch so this code activity can be managed and reviewed as any other source code proposal.
๐ฆ Live demo
As a live video worths a thousand words : discover how the Github Action runs on a dedicated repository :
๐ท Examples in details
โ Rejected PR because of lint failure
โ๏ธ Valid PR coming from GH Action
And code change review :
๐ช ROI
Now, both DEVs and OPs are using it to enhance yaml quality proactively with the help of CI and yaml quality issues are managed on our daily workflow on GH Issue.
๐ Also notice that all the teams using the GH Action have the same level of quality accross the whole organization.
๐ Acknowledgments ๐งโ๐คโ๐ง
A lot of thanks to the team that made this work come true, all on our DEVOPS pipeline :
Jerome ALET as core Yaml Fixer developer & integrator
Michรจle BARRE for Docker packaging and GH Action development
Daniel SANTOS for its test on DockerHub publish and his continuous feedbacks on this new Gh Action