read from the output instead of nothing

This commit is contained in:
Earl Warren 2023-11-01 16:32:39 +01:00
parent e35648c50c
commit 26490da8d2
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00

View file

@ -235,11 +235,11 @@ function wait_destination_ci() {
function upsert_fork() { function upsert_fork() {
if repo_curl ${options[destination_repo]} api_json ${options[destination_fork_api]} > $TMPDIR/fork.json 2> /dev/null ; then if repo_curl ${options[destination_repo]} api_json ${options[destination_fork_api]} > $TMPDIR/fork.json 2> /dev/null ; then
if test "$(jq --raw-output .fork)" != true ; then if test "$(jq --raw-output .fork < $TMPDIR/fork.json)" != true ; then
log_error "the destination fork already exists but is not a fork ${options[destination_fork]}" log_error "the destination fork already exists but is not a fork ${options[destination_fork]}"
return 1 return 1
fi fi
local forked_from_repo=$(jq --raw-output .parent.full_name) local forked_from_repo=$(jq --raw-output .parent.full_name < $TMPDIR/fork.json)
if test "$forked_from_repo" != "${options[destination_repo]}" ; then if test "$forked_from_repo" != "${options[destination_repo]}" ; then
log_error "${options[destination_fork]} must be a fork of ${options[destination_repo]} but is a fork of $forked_from_repo instead" log_error "${options[destination_fork]} must be a fork of ${options[destination_repo]} but is a fork of $forked_from_repo instead"
return 1 return 1