Nix Flake Updater #1297
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Nix Flake Updater | |
on: | |
workflow_dispatch: {} | |
schedule: | |
- cron: '0 0 * * *' | |
jobs: | |
update-packages: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: DeterminateSystems/nix-installer-action@v14 | |
with: | |
extra-conf: | | |
accept-flake-config = true | |
- name: Run the Magic Nix Cache | |
uses: DeterminateSystems/magic-nix-cache-action@v8 | |
- run: | | |
nix shell nixpkgs#git -c git config user.name 'NixBot' | |
nix shell nixpkgs#git -c git config user.email 'johnae@users.noreply.github.com' | |
nix shell .#world -c world gh-release-update | |
nix flake update | |
nix shell nixpkgs#git -c git commit -am "[auto] update flake inputs" | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v7 | |
id: cpr | |
with: | |
token: ${{ secrets.MACHINE_USER_TOKEN }} | |
commit-message: '[auto] package updates' | |
committer: GitHub <noreply@github.com> | |
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com> | |
signoff: false | |
branch: automatic-updates | |
delete-branch: true | |
title: '[auto] package updates' | |
body: '' | |
labels: | | |
automated pr | |
assignees: johnae | |
reviewers: johnae | |
- name: Enable Pull Request Automerge | |
if: steps.cpr.outputs.pull-request-operation == 'created' | |
uses: peter-evans/enable-pull-request-automerge@v3 | |
with: | |
token: ${{ secrets.MACHINE_USER_TOKEN }} | |
pull-request-number: ${{ steps.cpr.outputs.pull-request-number }} | |
merge-method: squash |