Skip to content

Execute On Schedule #7264

Execute On Schedule

Execute On Schedule #7264

Workflow file for this run

name: Execute On Schedule
on:
schedule:
- cron: '30 * * * *' # Executes at 30 minutes past the hour.
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository Contents
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install Python Packages Requirements
run: |
python -m pip install --upgrade pip
pip install -r requirements
- name: Execute Python Script
run: python main.py
- name: Commit Files
run: |
git config --local user.email "seyyedsoroushmirzaei@protonmail.com"
git config --local user.name "Soroush Mirzaei"
git add -A
git diff-index --quiet HEAD || (git commit -a -m "Updated $(TZ='Asia/Tehran' date '+%Y-%m-%d %H:%M %Z')" --allow-empty)
- name: Push Changes
uses: ad-m/github-push-action@v0.6.0
with:
github_token: ${{ secrets.TG_CNFG_CLLCT }}
branch: main
- name: Clean Up Files
run: |
git checkout --orphan latest_branch
git rm -r -f __pycache__
git config --local user.email "seyyedsoroushmirzaei@protonmail.com"
git config --local user.name "Soroush Mirzaei"
git add -A
git commit -am "Updated $(TZ='Asia/Tehran' date '+%Y-%m-%d %H:%M %Z')"
git branch -D main
git branch -m main
git push -f origin main
- name: Push Changes
uses: ad-m/github-push-action@v0.6.0
with:
github_token: ${{ secrets.TG_CNFG_CLLCT }}
branch: main