-
Notifications
You must be signed in to change notification settings - Fork 1
37 lines (37 loc) · 1.17 KB
/
cherry-pick.yml
File metadata and controls
37 lines (37 loc) · 1.17 KB
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
name: Backport merged pull request
on:
pull_request_target:
types: [closed]
issue_comment:
types: [created]
permissions:
contents: write # so it can comment
pull-requests: write # so it can create pull requests
jobs:
cherry-pick:
name: Cherry-pick pull request
runs-on: ubuntu-latest
if: >
(
github.event_name == 'pull_request_target' &&
github.event.pull_request.merged
) || (
github.event_name == 'issue_comment' &&
github.event.issue.pull_request &&
contains(github.event.comment.body, '/cherry-pick')
)
steps:
- uses: actions/create-github-app-token@v3
id: app-token
with:
app-id: ${{ vars.CI_APP_ID }}
private-key: ${{ secrets.CI_APP_KEY }}
- uses: actions/checkout@v6
- name: cherry-pick pull request
uses: creydr/cherry-pick-action@v1
with:
github_token: ${{ steps.app-token.outputs.token }}
add_author_as_assignee: true
auto_merge_method: "squash"
pull_title: "[${target_branch}] ${pull_title}"
pull_description: "Automated cherry-pick of #${pull_number} to ${target_branch}."