Update to on pull request. #7
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: 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 "[email protected]" | |
git config --local user.name "GitHub Action" | |
git add RULES.md | |
TIMESTAMP=$(date -u +"%Y-%m-%d") | |
git commit -m "Update RULES.md - $TIMESTAMP." || echo "No changes to commit." | |
git push |