diff --git a/.github/workflows/readme.yml b/.github/workflows/readme.yml index 263bb9c..d9304fa 100644 --- a/.github/workflows/readme.yml +++ b/.github/workflows/readme.yml @@ -23,15 +23,17 @@ jobs: - name: Update README.md badges run: | current_time=$(date +%s) - sed -i "s/\(https:\/\/img\.shields\.io\/.*&v=\)[0-9]*/\1$current_time/g" README.md + sed -i 's/\(v=\)[0-9]*/\1'"$current_time"'/g' README.md - name: Commit changes run: | git config --local user.email "action@github.com" git config --local user.name "GitHub Action" git add README.md - git commit -m "Update version to ${{ steps.get_version.outputs.VERSION }}" + git diff --quiet && git diff --staged --quiet || git commit -m "Update version to ${{ steps.get_version.outputs.VERSION }}" - name: Push changes - run: | - git push origin HEAD:${{ github.event.repository.default_branch }} + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + branch: ${{ github.event.repository.default_branch }}