Update README.md on tag creation #19
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 README.md on tag creation | |
on: | |
create: | |
jobs: | |
build: | |
if: startsWith(github.ref, 'refs/tags/') | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Update README.md | |
run: | | |
echo "Tag ${{ github.ref }} was created." | |
VERSION=${GITHUB_REF#refs/tags/} | |
sed "s/readme-\(.*\)-blue/readme-$VERSION-blue/g" README.md > temp.md | |
mv temp.md README.md | |
git config --local user.email "actions@github.com" | |
git config --local user.name "GitHub Actions" | |
git add README.md | |
git commit -m "Update README.md for tag '$VERSION' [skip ci]" | |
git push origin HEAD:main |