Skip to content

Update version

Update version #24

Workflow file for this run

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