Skip to content

Commit

Permalink
Copy the category label when cherry-picking (pantsbuild#16255)
Browse files Browse the repository at this point in the history
This is a little bit untested, but I did test the `jq` expression on the CLI 🤞 

[ci skip-rust]
[ci skip-build-wheels]
  • Loading branch information
thejcannon authored and jyggen committed Jul 27, 2022
1 parent 40fb204 commit 2658b14
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion build-support/bin/cherry_pick.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ fi

COMMIT=$(gh pr view "$PR_NUM" --json mergeCommit --jq '.mergeCommit.oid')
TITLE=$(gh pr view "$PR_NUM" --json title --jq '.title')
CATEGORY_LABEL=$(gh pr view "$PR_NUM" --json labels --jq '.labels.[] | select(.name|test("category:.")).name')
BODY_FILE=$(mktemp "/tmp/github.cherrypick.$PR_NUM.$MILESTONE.XXXXXX")
PR_CREATE_CMD=(gh pr create --base "$MILESTONE" --title "$TITLE (Cherry-pick of #$PR_NUM)" --body-file "$BODY_FILE")
PR_CREATE_CMD=(gh pr create --base "$MILESTONE" --title "$TITLE (Cherry-pick of #$PR_NUM)" --label "$CATEGORY_LABEL" --body-file "$BODY_FILE")
BRANCH_NAME="cherry-pick-$PR_NUM-to-$MILESTONE"

if [[ -z $COMMIT ]]; then
Expand Down

0 comments on commit 2658b14

Please sign in to comment.