Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yeboahd24/github-action
https://github.com/yeboahd24/github-action
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/yeboahd24/github-action
- Owner: yeboahd24
- Created: 2022-07-27T09:44:41.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-08T00:04:22.000Z (9 months ago)
- Last Synced: 2024-04-08T02:12:29.606Z (9 months ago)
- Language: Python
- Size: 76.2 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Schedule a Python script with GitHub Actions
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`
# Github-Action