diff --git a/cascading-pr.sh b/cascading-pr.sh index bf91efe..d45c9df 100755 --- a/cascading-pr.sh +++ b/cascading-pr.sh @@ -235,11 +235,11 @@ function wait_destination_ci() { function upsert_fork() { 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]}" return 1 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 log_error "${options[destination_fork]} must be a fork of ${options[destination_repo]} but is a fork of $forked_from_repo instead" return 1