More flakestat improvements
Some checks failed
pre-commit / pre-commit (push) Has been cancelled

This commit is contained in:
Torjus Håkestad 2024-07-06 17:05:10 +02:00
parent 59b19cb712
commit a38c2e344f

View File

@ -1,4 +1,5 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -eo pipefail
# Args: # Args:
# $1 text # $1 text
@ -38,9 +39,14 @@ unstable_rev=$(echo "$flake_metadata" | jq -r ".locks.nodes.$unstable_input.lock
unstable_branch=$(echo "$flake_metadata" | jq -r ".locks.nodes.$unstable_input.original.ref") unstable_branch=$(echo "$flake_metadata" | jq -r ".locks.nodes.$unstable_input.original.ref")
cd "$NIXPKGS_DIR" || print_output "?" "Could not find git repo dir" 1 cd "$NIXPKGS_DIR" || print_output "?" "Could not find git repo dir" 1
git fetch -q --all if ! git fetch -q --all; then
print_output "?" "Unable to fetch commits" 1
exit 1
fi
if ! unstable_commit_count=$(git rev-list --count "$unstable_rev..origin/$unstable_branch"); then if ! unstable_commit_count=$(git rev-list --count "$unstable_rev..origin/$unstable_branch"); then
print_output "?" "Unable to list commits" 1 print_output "?" "Unable to list commits" 1
exit 1
fi fi
text="$unstable_commit_count" text="$unstable_commit_count"