---
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@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
      - id: goversion
        run: echo "goversion=$(cat .go-version)" >> "$GITHUB_OUTPUT"
      - uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
        with:
          go-version: ${{ steps.goversion.outputs.goversion }}
      - env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        run: |
          set -euo pipefail

          ./scripts/measure-testgrid-flakiness.sh
