name: Check Firefox Candidate Release

on:
  schedule:
    - cron: "59 4 * * 2"
  workflow_dispatch:

permissions:
  contents: read

jobs:
  check_candidates:
    runs-on: ubuntu-latest

    steps:
      - name: Check out repository
        uses: actions/checkout@v3

      - name: Check for any updates
        env:
          DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
          DISCORD_PING_IDS: ${{ secrets.DISCORD_PING_IDS }}
        run: |
          python3 scripts/check_rc_response.py

  sync-upstream:
    name: Sync Upstream
    uses: ./.github/workflows/sync-upstream.yml
    permissions:
      contents: write
    secrets: inherit
    needs: [check_candidates]
    with:
      release_candidate: true
