Skip to content

Run Data1 Python script #40

Run Data1 Python script

Run Data1 Python script #40

Workflow file for this run

name: Run Data1 Python script
on:
schedule:
- cron: '20 3 * * *' # 11:20 AM IST (03:20 AM UTC)
- cron: '40 8 * * *' # 02:40 PM IST (08:40 AM UTC)
- cron: '50 12 * * *' # 06:50 PM IST (12:50 PM UTC)
- cron: '40 15 * * *' # 09:40 PM IST (03:40 PM UTC)
workflow_dispatch: # Allow manual triggering of the workflow
jobs:
run_script:
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.9'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install requests beautifulsoup4
- name: Load secrets
run: echo "KARM_URL=${{ secrets.KARM_URL }}" >> $GITHUB_ENV
- name: Run Python script
run: python data.py
- name: Commit changes
run: |
git config --local user.email "actions@github.com"
git config --local user.name "GitHub Actions"
git add data/data1.json || git commit -m "Create data1.json"
git commit -m "Update data1.json" || echo "No changes to commit"
git pull origin main || echo "No remote changes to pull"
git push origin main
- name: Push changes
uses: ad-m/github-push-action@v0.6.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: main