diff --git a/.github/workflows/upload-legacy-ami.yml b/.github/workflows/upload-legacy-ami.yml index 1538c46..3451dc6 100644 --- a/.github/workflows/upload-legacy-ami.yml +++ b/.github/workflows/upload-legacy-ami.yml @@ -36,7 +36,8 @@ jobs: id: download_ami run: | set -o pipefail - out=$(curl --location --silent --fail-with-body --header 'Accept: application/json' https://hydra.nixos.org/job/nixos/${{ matrix.release }}/nixos.amazonImage.${{ matrix.system }}/latest-finished | jq --raw-output '.buildoutputs.out.path') + build_id=$(curl -sSL -H 'Accept: application/json https://hydra.nixos.org/job/nixos/${{ matrix.release }}/tested/latest-finished | jq -r '.id') + out=$(curl -sSL -H 'Accept: application/json' https://hydra.nixos.org/build/${build_id}/constituents | jq -r '.[] | select(.job == "nixos.amazonImage.${{ matrix.system }}") | .buildoutputs.out.path') nix-store --realise "$out" --add-root ./result echo "image_info=$out/nix-support/image-info.json" >> "$GITHUB_OUTPUT"