Update Rules #330
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 | |
on: | |
schedule: | |
- cron: '0 0 * * *' | |
workflow_dispatch: | |
jobs: | |
check-rules: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
run: | | |
pip install requests | |
- name: Check if rules have changed and update | |
run: python bin/updaterules.py | |
- name: Set up Git | |
run: | | |
git config user.name "GitHub Actions" | |
git config user.email "[email protected]" | |
git remote set-url origin https://${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} | |
- name: Commit and push changes | |
run: | | |
git add rule_files/* | |
git commit -m "Update rule files" || exit 0 | |
git push origin HEAD:${{ github.ref }} |