Nix Flake Updater #1301
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 '[email protected]' | |
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 <[email protected]> | |
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 |