Update version badge #12
Workflow file for this run
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 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 }} |