Skip to content

Update PC Part Prices #40

Update PC Part Prices

Update PC Part Prices #40

Workflow file for this run

name: Update PC Part Prices
on:
schedule:
# Run daily at 2 AM UTC (adjust as needed)
- cron: '0 2 * * *'
workflow_dispatch: # Allow manual triggering
inputs:
debug:
description: 'Enable debug logging'
required: false
default: false
type: boolean
jobs:
update-prices:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.12'
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run price scraper
run: |
python scraper.py
env:
DEBUG: ${{ inputs.debug && '1' || '' }}
- name: Check for changes
id: git-check
run: |
git diff --exit-code || echo "changes=true" >> $GITHUB_OUTPUT
- name: Commit and push changes
if: steps.git-check.outputs.changes == 'true'
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add .
git commit -m "chore: update PC part prices [automated]"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}