name: Update Flakes

on:
  workflow_dispatch:
  schedule:
    - cron: "0 17 * * 0" # At 17:00 UTC / 2 Midnight JP on Sunday

jobs:
  update-flake-lock:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v4.1.3
      - uses: DeterminateSystems/nix-installer-action@main
      - name: Update flake.lock
        uses: DeterminateSystems/update-flake-lock@main
        with:
          git-author-name: "Ludovico Piero"
          git-author-email: "lewdovico@gnuweeb.org"
          git-committer-name: "Ludovico Piero"
          git-committer-email: "lewdovico@gnuweeb.org"
          token: ${{ secrets.GITHUB_TOKEN }}
          commit-msg: "chore: Update flake.lock" # The message provided with the commit
          pr-title: "Update flake.lock" # Title of PR to be created
          pr-labels: | # Labels to be set on the PR
            automated
            keep-up-to-date
