-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (40 loc) · 1.15 KB
/
docs-formatter.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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 }}