Format Documentation #75
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: Format Documentation | |
on: | |
schedule: | |
- cron: '0 * * * *' | |
push: | |
workflow_dispatch: | |
jobs: | |
generate-docs: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Git | |
run: | | |
git config --global user.name "GitHub Actions" | |
git config --global user.email "[email protected]" | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- run: | | |
npm install markdown-table-formatter -g | |
markdown-table-formatter ./*.md | |
markdown-table-formatter ./**/*.md | |
markdown-table-formatter ./docs/*.md | |
markdown-table-formatter ./docs/**/*.md | |
- name: Commit and push changes | |
run: | | |
if git diff --quiet ./; then | |
echo "Žádné změny, nic k commitování." | |
else | |
git add . | |
git commit -m "[Fix] markdown format" | |
git pull --rebase | |
git push origin HEAD:main | |
fi | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |