diff --git a/.github/workflows/repatriate.yml b/.github/workflows/repatriate.yml index 7f2ee86f81..5ab8124bef 100644 --- a/.github/workflows/repatriate.yml +++ b/.github/workflows/repatriate.yml @@ -49,14 +49,15 @@ jobs: git push --set-upstream origin "$merge_branch" fi - if url=$(gh pr view --json=url --jq=.url); then + url=$(gh pr list --limit=1 --head="$merge_branch" --state=open --json=url --jq='.[0].url') + if [[ -n "$url" ]]; then echo "::set-output name=verb::Updated" else gh pr create \ --title="[${next_ver}] Repatriate from ${this_ver}" \ --body="This PR merges ${this_branch} in to ${next_branch}." \ --base="$next_branch" - url=$(gh pr view --json=url --jq=.url) + url=$(gh pr list --limit=1 --head="$merge_branch" --state=open --json=url --jq='.[0].url') echo "::set-output name=verb::Created" fi echo "::set-output name=pr_url::${url}"