Skip to content

Check DigitalOcean Bill #104

Check DigitalOcean Bill

Check DigitalOcean Bill #104

Workflow file for this run

name: Check DigitalOcean Bill
on:
schedule:
- cron: "0 16 * * *" # run once a day at 12 AM (philippine standard time)
workflow_dispatch:
jobs:
curl:
runs-on: ubuntu-latest
env:
DIGITALOCEAN_TOKEN: ${{ secrets.DIGITALOCEAN_TOKEN }}
steps:
- name: GET /v2/customers/my/balance
run: |
MONTH_TO_DATE_USAGE=$(curl -X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/customers/my/balance" | jq '.month_to_date_usage')
echo "MONTH_TO_DATE_USAGE=$MONTH_TO_DATE_USAGE" >> $GITHUB_ENV
- name: "this month bill: ${{ env.MONTH_TO_DATE_USAGE }}"
run: echo $MONTH_TO_DATE_USAGE