Skip to content

Commit f7bb3cd

Browse files
author
T34
committed
add readme job -fix3
1 parent 3cd58c2 commit f7bb3cd

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

.github/workflows/readme.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,17 @@ jobs:
2323
- name: Update README.md badges
2424
run: |
2525
current_time=$(date +%s)
26-
sed -i "s/\(https:\/\/img\.shields\.io\/.*&v=\)[0-9]*/\1$current_time/g" README.md
26+
sed -i 's/\(v=\)[0-9]*/\1'"$current_time"'/g' README.md
2727
2828
- name: Commit changes
2929
run: |
3030
git config --local user.email "[email protected]"
3131
git config --local user.name "GitHub Action"
3232
git add README.md
33-
git commit -m "Update version to ${{ steps.get_version.outputs.VERSION }}"
33+
git diff --quiet && git diff --staged --quiet || git commit -m "Update version to ${{ steps.get_version.outputs.VERSION }}"
3434
3535
- name: Push changes
36-
run: |
37-
git push origin HEAD:${{ github.event.repository.default_branch }}
36+
uses: ad-m/github-push-action@master
37+
with:
38+
github_token: ${{ secrets.GITHUB_TOKEN }}
39+
branch: ${{ github.event.repository.default_branch }}

0 commit comments

Comments
 (0)