dotfiles

My PC Dotfiles & Website

update.yml (2048B)


name: "chore: Automatic Scheduled Updates"
on:
  workflow_dispatch:
  schedule:
    - cron: "0 0 1 * *"
env:
  NIX_SHOW_STATS: 1
jobs:
  update:
    runs-on: ubuntu-latest
    steps:
      - name: Clone Repo
        uses: actions/checkout@v7
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          fetch-depth: 0
      - name: Install Nix
        uses: cachix/install-nix-action@v31
        with:
          nix_path: nixpkgs=channel:nixos-unstable
          extra_nix_config: |
            experimental-features = nix-command flakes
            accept-flake-config = true
            access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
      - name: Update Flake Lock File
        uses: DeterminateSystems/update-flake-lock@v29
        with:
          branch: update_flake
          pr-labels: dependencies
          pr-title: >
            chore(flake): Update `inputs`
      - name: Update Packages
        env:
          GIT_AUTHOR_NAME: github-actions[bot]
          GIT_AUTHOR_EMAIL: <github-actions[bot]@users.noreply.github.com>
          GIT_COMMITTER_NAME: github-actions[bot]
          GIT_COMMITTER_EMAIL: <github-actions[bot]@users.noreply.github.com>
        run: |
          git checkout stable
          cd packages && ./update.sh
      - name: Create PR
        uses: peter-evans/create-pull-request@v8
        with:
          branch: update_packages
          delete-branch: true
          title: >
            chore(packages): Automatic Updates
          labels: dependencies
          body: |
            Automated package updates using `packages/update.sh`.
            ### Running GitHub Actions on this PR
            GitHub Actions will not run workflows on pull requests which are opened by a GitHub Action.
            To run GitHub Actions workflows on this PR, run:
            ```sh
            git branch -D update_packages
            git fetch origin
            git checkout update_packages
            git commit --amend --no-edit
            git push origin update_packages --force
            ```