fix: don't try to push missing store paths

This commit is contained in:
Defelo 2025-01-27 23:57:20 +01:00
commit d71c79f760
No known key found for this signature in database
GPG key ID: 2A05272471204DD3

View file

@ -108,9 +108,11 @@ jobs:
run: |
set -ex
attic=$(nix build --no-link --print-out-paths github:nixos/nixpkgs/nixos-unstable#attic-client)/bin/attic
realpath=$(nix build --no-link --print-out-paths github:nixos/nixpkgs/nixos-unstable#coreutils)/bin/realpath
$attic login default "$ATTIC_SERVER" "$ATTIC_TOKEN"
$attic cache info "$ATTIC_CACHE"
$attic push "$ATTIC_CACHE" ~/.cache/nixpkgs-review/pr-${{ inputs.pr }}/results/*
($realpath -qe ~/.cache/nixpkgs-review/pr-${{ inputs.pr }}/results/* || true) > paths
$attic push --stdin "$ATTIC_CACHE" < paths
info=$(curl -f -H "Authorization: Bearer ${ATTIC_TOKEN}" "${ATTIC_SERVER}_api/v1/cache-config/${ATTIC_CACHE}")
substituter_endpoint=$(jq -r .substituter_endpoint <<< "$info")
public_key=$(jq -r .public_key <<< "$info")
@ -122,9 +124,9 @@ jobs:
echo " $public_key" >> fetch_cmd
echo -n " '" >> fetch_cmd
ok=0
for p in ~/.cache/nixpkgs-review/pr-${{ inputs.pr }}/results/*; do
for p in $(cat paths); do
echo -e " \\" >> fetch_cmd
echo -n " $(realpath $p)" >> fetch_cmd
echo -n " $p" >> fetch_cmd
ok=1
done
[[ "$is_public" = "true" ]] && [[ $ok = 1 ]] || rm fetch_cmd