Skip to content

Update Nix

Update Nix #35

Workflow file for this run

name: Update Nix
on:
schedule:
- cron: "0 0 * * 4"
workflow_dispatch:
jobs:
update-nix:
name: Update Nix
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: main
ssh-key: ${{ secrets.UPDATE_SSH_KEY }}
- uses: cachix/install-nix-action@V27
- run: nix flake update
- name: Create PR
env:
GH_TOKEN: ${{ github.token }}
run: |
if test -z "$(git status)"; 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"