From 28fe0d12ca9fb2dc83d873bbabfd78429e6e361c Mon Sep 17 00:00:00 2001 From: "Richard Kuo (Danswer)" Date: Wed, 9 Oct 2024 10:55:47 -0700 Subject: [PATCH] try capturing gh output and parsing --- .github/workflows/hotfix-release-branches.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/hotfix-release-branches.yml b/.github/workflows/hotfix-release-branches.yml index 2fd3c5439..bdadc9f74 100644 --- a/.github/workflows/hotfix-release-branches.yml +++ b/.github/workflows/hotfix-release-branches.yml @@ -139,10 +139,13 @@ jobs: continue fi - # Create a new PR - PR_URL=$(gh pr create --title "Merge $HOTFIX_BRANCH into $RELEASE_BRANCH" \ + # Create a new PR and capture the output + PR_OUTPUT=$(gh pr create --title "Merge $HOTFIX_BRANCH into $RELEASE_BRANCH" \ --body "Automated PR to merge \`$HOTFIX_BRANCH\` into \`$RELEASE_BRANCH\`." \ - --head "$HOTFIX_BRANCH" --base "$RELEASE_BRANCH" --json url --jq '.url') + --head "$HOTFIX_BRANCH" --base "$RELEASE_BRANCH") + + # Extract the URL from the output + PR_URL=$(echo "$PR_OUTPUT" | grep -Eo 'https://github.com/[^ ]+') echo "Pull request created: $PR_URL"