mirror of
https://github.com/cachix/install-nix-action.git
synced 2025-06-08 01:54:27 +00:00
add github action to keep nix up-to-date
This commit is contained in:
parent
f5e4dbff3b
commit
129de1289f
2 changed files with 33 additions and 1 deletions
31
.github/workflows/update-nix.yml
vendored
Normal file
31
.github/workflows/update-nix.yml
vendored
Normal file
|
@ -0,0 +1,31 @@
|
|||
name: "Update nix"
|
||||
on:
|
||||
repository_dispatch:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: "31 2 * * *"
|
||||
jobs:
|
||||
update-nix-releases:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Update nix releases
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
latest_nix=$(
|
||||
gh api repos/NixOS/nix/tags --paginate --jq '.[].name' |
|
||||
grep -E '^[0-9]+\.[0-9]+\.[0-9]+$' |
|
||||
sort -V |
|
||||
tail -n 1
|
||||
)
|
||||
if [ -z "$latest_nix" ]; then
|
||||
echo "Failed to determine latest Nix version." >&2
|
||||
exit 1
|
||||
fi
|
||||
sed -i -E "s/nix_version=[0-9.]+/nix_version=${latest_nix}/" ./install-nix.sh
|
||||
- name: Create Pull Request
|
||||
uses: peter-evans/create-pull-request@v7
|
||||
with:
|
||||
title: Update nix versions
|
||||
labels: dependencies
|
Loading…
Add table
Add a link
Reference in a new issue