Skip to content

Commit

Permalink
add check if readme.md did actually change
Browse files Browse the repository at this point in the history
  • Loading branch information
McWhity committed Oct 16, 2024
1 parent 464c739 commit 25e13c9
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/convert_README_rst_to_md.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,15 @@ jobs:
- name: Commit changes
run: |
git add README.md
git commit -m "Convert README.rst to README.md"
git commit -m "Convert README.rst to README.md" || echo "No changes to commit"
- name: Check for README.md changes
id: check_readme
run: |
git diff --name-only | grep 'README.md' && echo "::set-output name=README_changed::true" || echo "::set-output name=README_changed::false"
# Use GITHUB_TOKEN to push changes directly to the current branch
- name: Push changes
if: steps.check_readme.outputs.README_changed == 'true'
run: git push origin HEAD
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Uses the default GitHub Actions token

0 comments on commit 25e13c9

Please sign in to comment.