-
Notifications
You must be signed in to change notification settings - Fork 4.8k
55 lines (53 loc) · 2.05 KB
/
cherry-picks.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Cherry Pick to remote repository
on:
pull_request_target:
types: [closed, labeled]
issue_comment:
types: [created]
permissions:
contents: write # so it can comment
pull-requests: write # so it can create pull requests and labels
jobs:
cross-repo-cherrypick:
name: Cherry pick to remote repository
runs-on: ubuntu-latest
# Only run when pull request is merged, or labeled
# or when a comment containing `/cherry-pick` is created
# and the author is a member, collaborator or owner
if: >
github.ref == 'refs/heads/master' &&
(
github.event_name == 'pull_request_target' &&
github.event.pull_request.merged
) || (
github.event_name == 'issue_comment' &&
github.event.issue.pull_request &&
contains(fromJSON('["MEMBER", "COLLABORATOR", "OWNER"]'), github.event.comment.author_association) &&
startsWith(github.event.comment.body, '/cherry-pick')
)
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.CHERRY_PICK_TOKEN }}
- name: Create backport pull requests
uses: jschmid1/cross-repo-cherrypick-action@9d2ead0043acba474373992c8175f2b8ffcdb31c #v1.2.0
id: cherry_pick
with:
token: ${{ secrets.CHERRY_PICK_TOKEN }}
pull_title: '[cherry-pick -> ${target_branch}] ${pull_title}'
merge_commits: 'skip'
trigger_label: 'cherry-pick kong-ee' # trigger based on this label
pull_description: |-
Automated cherry-pick to `${target_branch}`, triggered by a label in https://github.com/${owner}/${repo}/pull/${pull_number} :robot:.
## Original description
${pull_description}
upstream_repo: 'kong/kong-ee'
branch_map: |-
{
"master": "master"
}
- name: add label
if: steps.cherry_pick.outputs.was_successful == 'false'
uses: actions-ecosystem/action-add-labels@18f1af5e3544586314bbe15c0273249c770b2daf # v1.1.0
with:
labels: incomplete-cherry-pick