Skip to content

Daily Price Updates #35

Daily Price Updates

Daily Price Updates #35

Workflow file for this run

name: Daily Price Updates
on:
schedule:
- cron: '0 0 * * *' # Run at midnight UTC daily
workflow_dispatch: # Allow manual trigger
jobs:
update-prices:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"
- name: Update prices
run: python update_prices.py
- name: Check for changes
id: git-check
run: |
git status --porcelain
echo "changed=$(git status --porcelain | wc -l)" >> $GITHUB_OUTPUT
- name: Get current date
id: date
run: echo "date=$(date +'%d-%m-%Y')" >> $GITHUB_OUTPUT
- name: Show status
run: |
if [ "${{ steps.git-check.outputs.changed }}" -gt "0" ]; then
echo "Changes detected - will create PR"
git status
else
echo "No changes detected - skipping PR creation"
fi
- name: Create Pull Request
if: steps.git-check.outputs.changed > 0
uses: peter-evans/create-pull-request@v5
with:
commit-message: "chore: Update token prices (${{ steps.date.outputs.date }})"
title: "chore: Daily token price update (${{ steps.date.outputs.date }})"
body: |
GitHub Action to update token prices
This PR updates the token prices based on the latest data.
Changes detected:
```
${{ steps.git-check.outputs.changed }} files modified
```
branch: automated/price-updates-${{ steps.date.outputs.date }}
base: main
delete-branch: true
draft: false
reviewers: |
the-praxs
labels: |
automated
prices