Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update Nix every Wednesday #398

Merged
merged 1 commit into from
Jan 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/workflows/update_nix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Update Nix

on:
schedule:
- cron: "0 2 * * 1"

jobs:
update-nix:
name: Update Nix
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: main
- uses: cachix/install-nix-action@v24
- 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"