Skip to content

Commit 28fe0d1

Browse files
committed
try capturing gh output and parsing
1 parent d403840 commit 28fe0d1

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

.github/workflows/hotfix-release-branches.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,13 @@ jobs:
139139
continue
140140
fi
141141
142-
# Create a new PR
143-
PR_URL=$(gh pr create --title "Merge $HOTFIX_BRANCH into $RELEASE_BRANCH" \
142+
# Create a new PR and capture the output
143+
PR_OUTPUT=$(gh pr create --title "Merge $HOTFIX_BRANCH into $RELEASE_BRANCH" \
144144
--body "Automated PR to merge \`$HOTFIX_BRANCH\` into \`$RELEASE_BRANCH\`." \
145-
--head "$HOTFIX_BRANCH" --base "$RELEASE_BRANCH" --json url --jq '.url')
145+
--head "$HOTFIX_BRANCH" --base "$RELEASE_BRANCH")
146+
147+
# Extract the URL from the output
148+
PR_URL=$(echo "$PR_OUTPUT" | grep -Eo 'https://github.com/[^ ]+')
146149
147150
echo "Pull request created: $PR_URL"
148151

0 commit comments

Comments
 (0)