Skip to content

Update README.md on tag creation #19

Update README.md on tag creation

Update README.md on tag creation #19

Workflow file for this run

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