Generate cron rules #27
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: Generate cron rules | |
on: | |
schedule: | |
- cron: '0 0 * * 1' | |
workflow_dispatch: | |
permissions: | |
contents: write | |
actions: write # require to delete cache | |
jobs: | |
cron-gen: | |
name: Generate cron rules | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.PAT }} | |
- name: Set up Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install requests | |
- name: Generate Cron | |
run: python cron_generator.py | |
- name: Commit updated cron | |
run: | | |
git config --global user.email "${{ vars.EMAIL }}" | |
git config --global user.name "${{ vars.NAME }}" | |
git add . | |
git commit -m "Weekly cron gen: `date +'%Y-%m-%d'`" | |
git push |