name: Review BCR Pull Requests
on:
  schedule:
    - cron: "*/10 * * * *" # Run this action every 10 mins
  workflow_dispatch:       # So that this can be triggered manually

jobs:
  review_prs:
    runs-on: ubuntu-latest
    steps:
      - name: Harden Runner
        if: github.repository_owner == 'bazelbuild'
        uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
        with:
          egress-policy: audit

      - name: Run BCR PR Reviewer
        if: github.repository_owner == 'bazelbuild'
        uses: bazelbuild/continuous-integration/actions/bcr-pr-reviewer@6dee85d41eb668143c778547c819ab6bdfebc223 # master
        with:
          # This token needs to be updated annually on Feb 05.
          token: ${{ secrets.BCR_PR_REVIEW_HELPER_TOKEN }}
          action-type: review_prs
