name: Daily link check

on:
  schedule:
    # Daily at 02:00 UTC
    - cron: "0 2 * * *"
  workflow_dispatch:

permissions:
  contents: read

jobs:
  link-check:
    uses: ./.github/workflows/reusable-link-check.yml

  workflow-notification:
    permissions: # required by the reusable workflow
      contents: read
      issues: write
    needs:
      - link-check
    if: always()
    uses: ./.github/workflows/reusable-workflow-notification.yml
    with:
      success: ${{ needs.link-check.result == 'success' }}
