chore: ci-update
All checks were successful
Update Nix Packages with nix-update / nix-update (push) Successful in 40m47s
All checks were successful
Update Nix Packages with nix-update / nix-update (push) Successful in 40m47s
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell --pure -i bash -p bash curl jq nix cacert git
|
||||
set -euo pipefail
|
||||
|
||||
# Update kestractl sources.json with the latest release from GitHub.
|
||||
# Usage: ./update.sh
|
||||
# Called automatically by: nix-update --update-script kestractl
|
||||
# Usage: ./update.sh (or via nix-update --update-script)
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
SOURCES_FILE="$SCRIPT_DIR/sources.json"
|
||||
@@ -49,3 +49,13 @@ jq -n \
|
||||
> "$SOURCES_FILE"
|
||||
|
||||
echo "Updated $SOURCES_FILE to $VERSION"
|
||||
|
||||
# Commit when running in CI or via nix-update
|
||||
if [[ -d "$SCRIPT_DIR/../../.git" ]] || git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
|
||||
NIXPKGS_ROOT=$(git -C "$SCRIPT_DIR" rev-parse --show-toplevel 2>/dev/null || true)
|
||||
if [[ -n "$NIXPKGS_ROOT" && -n "$(git -C "$NIXPKGS_ROOT" status --porcelain "$SOURCES_FILE")" ]]; then
|
||||
git -C "$NIXPKGS_ROOT" add "$SOURCES_FILE"
|
||||
git -C "$NIXPKGS_ROOT" commit -m "kestractl: ${CURRENT_VERSION} -> ${VERSION}"
|
||||
echo "Committed update to git"
|
||||
fi
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user