Skip to content

Commit a3e0fbd

Browse files
committed
Add a label to the PR when one is defined.
1 parent 5c3e66c commit a3e0fbd

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

.github/workflows/backport.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,10 +277,14 @@ jobs:
277277
PR_HEAD="${STEPS_BACKPORT_BRANCH_OUTPUTS_NAME}"
278278
fi
279279
280-
gh pr create \
280+
PR_URL=$(gh pr create \
281281
--repo "${PR_REPO}" \
282282
--base "${MATRIX_BRANCH}" \
283283
--head "${PR_HEAD}" \
284284
--title "$PR_TITLE" \
285285
--assignee "${GITHUB_ACTOR}" \
286-
--body "$(echo -e "$BODY")"
286+
--body "$(echo -e "$BODY")")
287+
288+
if gh label list --repo "${PR_REPO}" --json name --jq '[.[].name] | contains(["Auto-backport"])' | grep -q 'true'; then
289+
gh pr edit "$PR_URL" --repo "${PR_REPO}" --add-label 'Auto-backport'
290+
fi

0 commit comments

Comments
 (0)