Skip to content

Instantly share code, notes, and snippets.

@optroodt
Created July 13, 2021 12:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save optroodt/a1dc85dce4848cc4ef1c9c18b2e0bfff to your computer and use it in GitHub Desktop.
Save optroodt/a1dc85dce4848cc4ef1c9c18b2e0bfff to your computer and use it in GitHub Desktop.
Replace black formatter version in several repos (hacky)
#!/bin/bash
OIFS=$IFS
IFS="
"
ORIGNAL_BLACK="lgeiger/black-action@master"
NEW_BLACK="tripactions/black-code-formatter@21.4b1"
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