https://github.com/patrickloeber/python-github-action-template
Schedule a Python script with GitHub Actions
https://github.com/patrickloeber/python-github-action-template
Last synced: 7 days ago
JSON representation
Schedule a Python script with GitHub Actions
- Host: GitHub
- URL: https://github.com/patrickloeber/python-github-action-template
- Owner: patrickloeber
- Created: 2022-07-19T08:44:56.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-03-31T00:53:51.000Z (15 days ago)
- Last Synced: 2025-03-31T23:33:41.688Z (14 days ago)
- Language: Python
- Size: 97.7 KB
- Stars: 310
- Watchers: 8
- Forks: 278
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- jimsghstars - patrickloeber/python-github-action-template - Schedule a Python script with GitHub Actions (Python)
README
# Schedule a Python script with GitHub Actions
**Watch the video tutorial:**
[](https://youtu.be/PaGp7Vi5gfM)
This example shows how to run a Python script as cron job with GitHub Actions. It calls an API once a week (could be any schedule you want), logs the response in `status.log`, and automatically pushes the changes to this repo.
- Implement your script in `main.py`
- Inspect and configure cron job in GitHub Action `.github/workflows/actions.yml`
- It can install and use third party packages from `requirements.txt`
- Secret environment variables can be used. Set secrets in Settings/Secrets/Actions -> 'New repository secret'. Use the same secret name inside `actions.yml` and `main.py`