Skip to content

Update version badge #9

Update version badge

Update version badge #9

Workflow file for this run

name: Update version badge
on:
release:
types: [published]
jobs:
update_readme:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Get current version
id: package_version
run: |
VERSION=$(jq -r .version ./package.json)
echo "::set-output name=version::$VERSION"
- name: Update README file
run: |
sed -i "s|badge/version-.*-blue|badge/version-${{ github.event.release.tag_name }}-blue|g" README.md
- name: Setup git
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git switch -c main
git commit -am "Update README badges"
- name: Push changes
run: git push origin main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}