Update version #24
This file contains 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
name: Update README with Version | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
update-readme: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
with: | |
token: ${{ secrets.UNIFIREPO_PERSONAL_ACCESS_TOKEN }} | |
- name: Read version from file | |
run: echo "VERSION=$(cat version)" >> $GITHUB_ENV | |
- name: Update README.md | |
run: | | |
VERSION=$(cat version) | |
sed -i "s/badge\/version-.*-blue/badge\/version-$VERSION-blue/" README.md | |
- name: Commit and push if changed | |
run: | | |
git config --global user.email ${{ secrets.EMAIL }} | |
git config --global user.name "ZSamuels28" | |
git diff | |
if git diff --exit-code README.md; then | |
echo "No changes to the README" | |
exit 0 | |
fi | |
git add README.md | |
git commit -m "Update README with new version $VERSION" | |
git push |