name: Check for updates
on:
  schedule: # for scheduling to work this file must be in the default branch
    - cron: "0 0 * * 0" # 00:00 on every Sunday
  workflow_dispatch: # can be manually dispatched under GitHub's "Actions" tab

jobs:
  flatpak-external-data-checker:
    runs-on: ubuntu-latest

    strategy:
      matrix:
        branch: [ master ] # list all branches to check

    steps:
        # 4.2.2
      - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
        with:
          ref: ${{ matrix.branch }}

      - uses: docker://ghcr.io/flathub-infra/flatpak-external-data-checker:latest@sha256:9e64f59dc8b92b4e7cf325a3f2ef98a64beaf721b58803801d3bf66269203221
        env:
          GIT_AUTHOR_NAME: flathubbot
          GIT_COMMITTER_NAME: flathubbot
          GIT_AUTHOR_EMAIL: sysadmin@flathub.org
          GIT_COMMITTER_EMAIL: sysadmin@flathub.org
          EMAIL: sysadmin@flathub.org
          GITHUB_TOKEN: ${{ secrets.FLATHUBBOT_TOKEN }}
        with:
          # We don't want the default entrypoint, we want our own script
          entrypoint: ./update-checker.sh
