---
name: Measure TestGrid Flakiness

on:
  schedule:
    - cron: "0 0 * * *" # run every day at midnight

permissions: read-all

jobs:
  measure-testgrid-flakiness:
    name: Measure TestGrid Flakiness
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
      - id: goversion
        run: echo "goversion=$(cat .go-version)" >> "$GITHUB_OUTPUT"
      - uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
        with:
          go-version: ${{ steps.goversion.outputs.goversion }}
      - env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        run: |
          set -euo pipefail

          ./scripts/measure-testgrid-flakiness.sh
