debug workflow #22
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Convert README from RST to Markdown | |
on: [pull_request, push] | |
jobs: | |
update_readme: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v2 # Automatically checks out the branch that triggered the workflow | |
- name: Configure Git | |
run: | | |
git config user.name "Thomas Weiß" | |
git config user.email "[email protected]" | |
- name: Install Pandoc | |
run: sudo apt-get update && sudo apt-get install pandoc | |
- name: Convert README.rst to README.md | |
run: pandoc README.rst -f rst -t markdown -o README.md | |
- name: Commit changes | |
run: | | |
git add 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" | |
- 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 |