name: Constant Check
on:
  pull_request:
    branches:
      - main
  push:
    branches:
      - main
  schedule:
    - cron: "0 0 * * *"
jobs:
  check:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: denoland/setup-deno@v1
        with:
          deno-version: 1.x
      - name: Check constant updates
        run: deno run -A ./scripts/update-constant.ts
      - name: Check if workspace is clean
        run: git diff --exit-code
