-
Notifications
You must be signed in to change notification settings - Fork 5
39 lines (32 loc) · 1005 Bytes
/
update-rules.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
name: Update Rules Page
on:
pull_request:
branches: [main]
paths:
- 'styles/**'
- '.github/workflows/update-rules.yml'
jobs:
generate_markdown:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.x
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pyyaml
- name: Run script to generate Markdown
run: python scripts/update-rules-page.py
- name: Commit and push changes
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add -f RULES.md
TIMESTAMP=$(date -u +"%Y-%m-%d")
git commit -m "Update RULES.md - $TIMESTAMP." || echo "No changes to commit."
git config pull.rebase true
git pull origin ${{ github.head_ref }}
git push origin HEAD:${{ github.head_ref }}