Skip to content

Run Data Python script #58

Run Data Python script

Run Data Python script #58

Workflow file for this run

name: Run Data.py Python script
on:
schedule:
- cron: '1 */5 * * *' # runs at the first minute of every 6th hour. (12:01a, 6:01a, 12:01p, and 6:01p)
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: Run Python script
env:
KARM_URL: ${{ secrets.KARM_URL }}
run: python data.py
- name: Commit changes
run: |
git config --local user.email "[email protected]"
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/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: main