Skip to content

Update Nix

Update Nix #24

Workflow file for this run

name: Update Nix
on:
schedule:
- cron: "0 0 * * 3"
workflow_dispatch:
jobs:
update-nix:
name: Update Nix
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: main
- uses: cachix/install-nix-action@v30
- run: nix flake update
- name: Create PR
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if test -z "$(git status --porcelain)"; then exit 0; fi
git config --global user.name "Github Actions"
git config --global user.email "[email protected]"
BRANCH="nix-update-$(date -I)"
git checkout -b "$BRANCH"
git add flake.lock
git commit --message "update Nix sources" --author "GitHub Actions <[email protected]>"
git push -u origin "$BRANCH"
gh pr create \
--title "Update Nix sources, $(date -I)" \
--body "Automatically generated by GitHub actions at $(date)" \
--head "$BRANCH"