Skip to content

Bike Tracker

Bike Tracker #15

Workflow file for this run

name: Bike Tracker
on:
schedule:
# Runs every 5 minutes between 8:00 AM and 10:00 AM ET (12:00 PM - 2:00 PM UTC)
- cron: '*/5 19 * * *'
jobs:
track_bikes:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
persist-credentials: false # Disables token for security on public repos
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: pip install requests
- name: Run bike tracking script
run: python get_bikes.py
- name: Commit and push CSV changes
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Actions"
git add bike_availability.csv
git commit -m "Update bike availability data"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}