Skip to content

Instantly share code, notes, and snippets.

@mrlnc
Created June 30, 2022 08:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrlnc/1ebaaeac5d7b3951f6a7bfa2a0abc468 to your computer and use it in GitHub Desktop.
Save mrlnc/1ebaaeac5d7b3951f6a7bfa2a0abc468 to your computer and use it in GitHub Desktop.
Github Action: run python script & commit results
name: fetch website and commit results
on:
schedule:
- cron: "30 * * * *"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: set timezone
uses: szenius/set-timezone@v1.0
with:
timezoneLinux: "Europe/Berlin"
# checkout repo to actions runner
- name: checkout repo content
uses: actions/checkout@v2
- name: setup python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: execute py script
run: |
python fetch_bs.py
- name: setup git config
run: |
# setup git
git config user.name "GitHub Actions Bot"
git config user.email "<>"
- name: commit
run: |
# Stage the file, commit and push
git add results.csv
git commit -m "update results"
git push origin main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment