Created
July 13, 2021 12:30
-
-
Save optroodt/a1dc85dce4848cc4ef1c9c18b2e0bfff to your computer and use it in GitHub Desktop.
Replace black formatter version in several repos (hacky)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
OIFS=$IFS | |
IFS=" | |
" | |
ORIGNAL_BLACK="lgeiger/black-action@master" | |
NEW_BLACK="tripactions/[email protected]" | |
BRANCH="youri/update_black_code_formatter" | |
for i in `grep -iER "lgeiger/black-action@master" --include "*.yml" .` | |
do | |
REPO=`echo $i | cut -d "/" -f 2` | |
FILE=`echo $i | cut -d ":" -f 1 | sed "s/\.\/${REPO}\///"` | |
cd $REPO | |
git checkout master | |
git pull | |
git checkout -b $BRANCH | |
git checkout $BRANCH | |
sed -i '' -e "s/lgeiger\/black-action\@master/tripactions\/black-code-formatter\@21\.4b1/g" ${FILE} | |
git add $FILE | |
git commit -m "Pin GA black code formatter to 21.4b1" | |
git push origin $BRANCH | |
cd .. | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment