Skip to content

Coinbase

Coinbase #111574

Workflow file for this run

name: Coinbase
on:
workflow_dispatch:
schedule:
- cron: '*/5 * * * *'
concurrency: commit
jobs:
price_history:
name: Update Coinbase
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3.0'
- name: Config git user
run: |
git config user.name "Russell Smith"
git config user.email ukd1@users.noreply.github.com
- name: Update price history
run: |
cd coinbase
curl "https://api.pro.coinbase.com/currencies" | jq "sort_by(.id)" > currencies.json
git add currencies.json
git commit currencies.json -m "Updated Coinbase currencies in run ${GITHUB_RUN_NUMBER}" || true
curl "https://api.pro.coinbase.com/products" | jq "sort_by(.id)" > products.json
git add products.json
git commit products.json -m "Updated Coinbase products in run ${GITHUB_RUN_NUMBER}" || true
rm -rf 24h_stats/*.json
ruby 24h_stats.rb
git add 24h_stats/*.json
git commit 24h_stats/*.json -m "Updated Coinbase price history in run ${GITHUB_RUN_NUMBER}" || true
cd .. && chmod +x add_last_commit.sh && ./add_last_commit.sh
git add coinbase/jsonl/*.jsonl
git commit coinbase/jsonl -m "Updated Coinbase jsonl price history in run ${GITHUB_RUN_NUMBER}" || true
- name: Push repo
run: git push || true