Skip to content

Commit c056342

Browse files
committed
Make sure PR goes to the upstream repo/
1 parent a263282 commit c056342

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

.github/workflows/backport.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -298,17 +298,16 @@ jobs:
298298
PR_HEAD="${STEPS_BACKPORT_BRANCH_OUTPUTS_NAME}"
299299
fi
300300
301-
PR_URL=$(gh pr create \
302-
--repo "${PR_REPO}" \
301+
PR_URL=$(GH_REPO="${PR_REPO}" gh pr create \
303302
--base "${MATRIX_BRANCH}" \
304303
--head "${PR_HEAD}" \
305304
--title "$PR_TITLE" \
306305
--assignee "${GITHUB_ACTOR}" \
307306
--draft \
308307
--body "$(echo -e "$BODY")")
309308
310-
if gh label list --repo "${PR_REPO}" --json name --jq '[.[].name] | contains(["Auto-backport"])' | grep -q 'true'; then
311-
gh pr edit "$PR_URL" --repo "${PR_REPO}" --add-label 'Auto-backport'
309+
if GH_REPO="${PR_REPO}" gh label list --json name --jq '[.[].name] | contains(["Auto-backport"])' | grep -q 'true'; then
310+
GH_REPO="${PR_REPO}" gh pr edit "$PR_URL" --add-label 'Auto-backport'
312311
else
313312
echo "::notice::The 'Auto-backport' label does not exist on ${PR_REPO}. Consider adding it so that backport pull requests can be identified easily."
314313
fi

0 commit comments

Comments
 (0)