You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Create the pull request with labels (returns URL like https://github.com/owner/repo/pull/123)
210
-
PR_URL=$(gh pr create \
262
+
if ! PR_URL=$(gh pr create \
211
263
--title "[$BRANCH] $PR_TITLE (#$PR_NUMBER)" \
212
264
--body "$PR_BODY" \
213
265
--base "$BRANCH" \
214
266
--head "$NEW_BRANCH" \
215
267
--label "$LABELS_LIST" \
216
-
$DRAFT_FLAG 2>&1)
217
-
218
-
if [ $? -ne 0 ] || [ -z "$PR_URL" ]; then
268
+
$DRAFT_FLAG 2>&1) || [ -z "$PR_URL" ]; then
219
269
echo "Error: Failed to create PR for branch $NEW_BRANCH"
220
270
echo "$PR_URL"
221
271
git checkout main
@@ -250,7 +300,7 @@ jobs:
250
300
else
251
301
echo " Draft: false"
252
302
fi
253
-
echo " Repository: ${{ github.repository }}"
303
+
echo " Repository: $GITHUB_REPOSITORY"
254
304
echo ""
255
305
echo " [DRY RUN] Would add labels:"
256
306
echo "$LABELS_JSON" | jq -r '.[]' | while read -r label; do
@@ -262,7 +312,7 @@ jobs:
262
312
if [ "$CONFLICT" = true ]; then
263
313
CONFLICT_COMMENT="Hello @${PR_AUTHOR}, there are conflicts in this ${PORT_TYPE}."$'\n\n'
264
314
CONFLICT_COMMENT+="Please address them in order to merge this Pull Request. You can execute the snippet below to reset your branch and resolve the conflict manually."$'\n\n'
265
-
CONFLICT_COMMENT+="Make sure you replace \`origin\` by the name of the ${{ github.repository_owner }}/${{ github.event.repository.name }} remote"$'\n'
315
+
CONFLICT_COMMENT+="Make sure you replace \`origin\` by the name of the ${GITHUB_REPOSITORY} remote"$'\n'
# Create the pull request with labels (returns URL like https://github.com/owner/repo/pull/123)
406
-
PR_URL=$(gh pr create \
458
+
if ! PR_URL=$(gh pr create \
407
459
--title "[$BRANCH] $PR_TITLE (#$PR_NUMBER)" \
408
460
--body "$PR_BODY" \
409
461
--base "$BRANCH" \
410
462
--head "$NEW_BRANCH" \
411
463
--label "$LABELS_LIST" \
412
-
$DRAFT_FLAG 2>&1)
413
-
414
-
if [ $? -ne 0 ] || [ -z "$PR_URL" ]; then
464
+
$DRAFT_FLAG 2>&1) || [ -z "$PR_URL" ]; then
415
465
echo "Error: Failed to create PR for branch $NEW_BRANCH"
416
466
echo "$PR_URL"
417
467
git checkout main
@@ -446,7 +496,7 @@ jobs:
446
496
else
447
497
echo " Draft: false"
448
498
fi
449
-
echo " Repository: ${{ github.repository }}"
499
+
echo " Repository: $GITHUB_REPOSITORY"
450
500
echo ""
451
501
echo " [DRY RUN] Would add labels:"
452
502
echo "$LABELS_JSON" | jq -r '.[]' | while read -r label; do
@@ -458,10 +508,10 @@ jobs:
458
508
if [ "$CONFLICT" = true ]; then
459
509
CONFLICT_COMMENT="Hello @${PR_AUTHOR}, there are conflicts in this ${PORT_TYPE}."$'\n\n'
460
510
CONFLICT_COMMENT+="Please address them in order to merge this Pull Request. You can execute the snippet below to reset your branch and resolve the conflict manually."$'\n\n'
461
-
CONFLICT_COMMENT+="Make sure you replace \`origin\` by the name of the ${{ github.repository_owner }}/${{ github.event.repository.name }} remote"$'\n'
511
+
CONFLICT_COMMENT+="Make sure you replace \`origin\` by the name of the ${GITHUB_REPOSITORY} remote"$'\n'
0 commit comments