Quota Check #230
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Quota Check | |
permissions: | |
contents: read | |
on: | |
schedule: | |
- cron: "0 15 * * *" | |
# Allow manual triggering for testing | |
workflow_dispatch: | |
jobs: | |
quota-check: | |
environment: operations | |
name: Check quota usage | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4 | |
name: Checkout code | |
- name: Delete huge unnecessary tools folder | |
run: rm -rf /opt/hostedtoolcache | |
- name: Setup Go | |
uses: ./.github/actions/setup-go | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build CLI | |
working-directory: ./go | |
run: | | |
go build -o unkey . | |
- name: Run quota check | |
working-directory: ./go | |
env: | |
CLICKHOUSE_URL: ${{ secrets.CLICKHOUSE_URL }} | |
DATABASE_DSN: ${{ secrets.DATABASE_DSN }} | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
run: | | |
./unkey quotacheck | |
- name: Send Heartbeat | |
run: curl ${{ secrets.QUOTA_CHECK_HEARTBEAT_URL }} |