name: Update Flake Inputs

on:
  schedule:
    # Run every 5 hours
    - cron: "0 */5 * * *"
  workflow_dispatch:
  repository_dispatch:

jobs:
  update-flake-inputs:
    runs-on: nix
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0

      - name: Update flake inputs
        uses: Mic92/update-flake-inputs-gitea@main
        with:
          # Exclude private flakes and update-clan-core checks flake
          exclude-patterns: "checks/impure/flake.nix"
          auto-merge: true
          git-author-name: "clan-bot"
          git-committer-name: "clan-bot"
          git-author-email: "clan-bot@clan.lol"
          git-committer-email: "clan-bot@clan.lol"
          gitea-token: ${{ secrets.CI_BOT_TOKEN }}
          github-token: ${{ secrets.CI_BOT_GITHUB_TOKEN }}
