n8n: auto update to highest stable version

Previously it updated to the version that GitHub marked as latest, but
this could be a few versions behind sometimes.
This commit is contained in:
Gutyina Gergő
2026-02-25 20:03:14 +01:00
parent 892be3c620
commit 36ba0bc39a
+2 -1
View File
@@ -2,5 +2,6 @@
#!nix-shell --pure -i bash -p bash curl jq nix-update cacert git
set -euo pipefail
new_version="$(curl -s "https://api.github.com/repos/n8n-io/n8n/releases/latest" | jq --raw-output '.tag_name | ltrimstr("n8n@")')"
new_version="$(curl -s "https://api.github.com/repos/n8n-io/n8n/releases?per_page=30" | \
jq --raw-output 'map(select(.prerelease | not) | .tag_name) | sort | last | ltrimstr("n8n@")')"
nix-update n8n --version "$new_version"