I needed to update the CODEOWNERS file for our the git repositories my team owns. Instead of going through each one and doing the same change over and over I knew that this could be automated. For this I used these two tools Mani and Github CLI
🏗️ Setup repositories
The mani config file needs to know about my repositories in it’s config file, looking something like this:
Instead of manually typing them I used the Github CLI to fetch the names, and then using some multi cursor editing I quickly created the config file
Then I used mani sync to get it clone all the repositories.
📝 Make the change
My change was quite simple, so I just created the correct file I wanted and then for each repository I copied it over.
🚀 Commit, push, and make PR’s
Note: You might need to run the last command a few times, as the github api rate limits how many PR’s you can create