Skip to content

Commit 5f4ef36

Browse files
committed
Support cherry-picking prs with /cherry-pick <branch_name> comment
1 parent 788bf22 commit 5f4ef36

2 files changed

Lines changed: 25 additions & 5 deletions

File tree

.github/workflows/add-remove-labels.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@ on:
77

88
issue_comment:
99
types: [created, edited, deleted]
10-
if: |
11-
contains(github.event.comment.body, '/wip') ||
12-
contains(github.event.comment.body, '/verified') ||
13-
contains(github.event.comment.body, '/lgtm') ||
14-
contains(github.event.comment.body, '/hold')
1510

1611

1712
permissions:
@@ -21,6 +16,12 @@ permissions:
2116

2217
jobs:
2318
add-remove-labels:
19+
if: |
20+
contains(github.event.comment.body, '/wip') ||
21+
contains(github.event.comment.body, '/verified') ||
22+
contains(github.event.comment.body, '/lgtm') ||
23+
contains(github.event.comment.body, '/hold') ||
24+
contains(github.event.comment.body, '/cherry-pick')
2425
runs-on: ubuntu-latest
2526

2627
steps:
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Cherry Pick On Comment
2+
on:
3+
issue_comment:
4+
types: [created]
5+
jobs:
6+
cherry-pick:
7+
name: Cherry Pick
8+
if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/cherry-pick')
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout the latest code
12+
uses: actions/checkout@v2
13+
with:
14+
token: ${{ secrets.OPENDATAHUB_TESTS_BOT_PAT }}
15+
fetch-depth: 0 # otherwise, you will fail to push refs to dest repo
16+
- name: Automatic Cherry Pick
17+
uses: dbasunag/cherry-pick-pr@master
18+
env:
19+
GITHUB_TOKEN: ${{ secrets.OPENDATAHUB_TESTS_BOT_PAT }}

0 commit comments

Comments
 (0)