Create fix_readme.yml

This commit is contained in:
Shixian Sheng 2024-05-17 14:41:08 -04:00 committed by GitHub
parent 209b980304
commit 18e34bfca7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

25
.github/workflows/fix_readme.yml vendored Normal file
View File

@ -0,0 +1,25 @@
name: Update README
on:
push:
jobs:
update-readme:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Replace VARIABLE in README.md
run: |
BRANCH_NAME=${GITHUB_REF#refs/heads/}
sed -i "s/VARIABLE/$BRANCH_NAME/g" README.md
- name: Commit and push if it changed
run: |
git diff
git config --global user.email "actions@github.com"
git config --global user.name "GitHub Action"
git commit -am "Update README.md" --allow-empty
git push