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