Skip to content

run main.py

run main.py #109035

Workflow file for this run

# run a python program that creates a new file and stores a random number in it
name: run main.py
on:
schedule:
- cron: '* * * * *'
jobs:
setup:
runs-on: ubuntu-22.04
container:
image: python:3
steps:
- name: Checkout current repository
uses: actions/checkout@v3
- name: Install dependencies
run: pip install -r requirements.txt
- name: Execute python script
run: python3 main.py
- name: Commit files
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add -A
git diff-index --quiet HEAD || (git commit -a -m "updated logs" --allow-empty)
- name: Push changes
uses: ad-m/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: main