-
Notifications
You must be signed in to change notification settings - Fork 27
/
action.yml
150 lines (136 loc) · 6.79 KB
/
action.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
name: Backport merged pull requests to selected branches
description: >
Fast and flexible action to cherry-pick commits from labeled pull requests
author: korthout
inputs:
branch_name:
description: >
Template used as the name for branches created by this action.
Placeholders can be used to define variable values.
These are indicated by a dollar sign and curly braces (`${placeholder}`).
Please refer to this action's README for all available placeholders.
default: backport-${pull_number}-to-${target_branch}
cherry_picking:
description:
Determines which commits are cherry-picked.
When set to `auto`, the action cherry-picks the commits based on the method used to merge the pull request.
- For "Squash and merge", the action cherry-picks the squashed commit.
- For "Rebase and merge", the action cherry-picks the rebased commits.
- For "Merged as a merge commit", the action cherry-picks the commits from the pull request.
When set to `pull_request_head`, the action cherry-picks the commits from the pull request.
Specifically, those reachable from the pull request's head and not reachable from the pull request's base.
By default, the action cherry-picks the commits based on the method used to merge the pull request.
default: auto
copy_assignees:
description: >
Controls whether to copy the assignees from the original pull request to the backport pull request.
By default, the assignees are not copied.
default: false
copy_labels_pattern:
description: >
Regex pattern to match github labels which will be copied from the original pull request to the backport pull request.
Note that labels matching `label_pattern` are excluded.
By default, no labels are copied.
copy_milestone:
description: >
Controls whether to copy the milestone from the original pull request to the backport pull request.
By default, the milestone is not copied.
default: false
copy_requested_reviewers:
description: >
Controls whether to copy the requested reviewers from the original pull request to the backport pull request.
Note that this does not request reviews from those users who already reviewed the original pull request.
By default, the requested reviewers are not copied.
default: false
experimental:
description: >
Configure experimental features by passing a JSON object.
The following properties can be specified:
#### `conflict_resolution`
Specifies how the action will handle a conflict occuring during the cherry-pick.
In all cases, the action will stop the cherry-pick at the first conflict encountered.
Behavior is defined by the option selected.
- When set to `fail` the backport fails when the cherry-pick encounters a conflict.
- When set to `draft_commit_conflicts` the backport will always create a draft pull request with the first conflict encountered committed.
Instructions are provided on the original pull request on how to resolve the conflict and continue the cherry-pick.
#### `downstream_repo`
Define if you want to backport to a repository other than where the workflow runs.
By default, the action always backports to the repository in which the workflow runs.
#### `downstream_owner`
Define if you want to backport to another owner than the owner of the repository the workflow runs on.
Only takes effect if the `downstream_repo` property is also defined.
By default, uses the owner of the repository in which the workflow runs.
default: >
{
"conflict_resolution": "fail"
}
github_token:
description: >
Token to authenticate requests to GitHub.
Used to create and label pull requests and to comment.
Either GITHUB_TOKEN or a repo-scoped Personal Access Token (PAT).
default: ${{ github.token }}
github_workspace:
description: Working directory for the backport action.
default: ${{ github.workspace }}
label_pattern:
description: >
Regex pattern to match the backport labels on the merged pull request.
Must contain a capture group for the target branch.
The action will backport the pull request to each matched target branch.
Note that the pull request's headref is excluded automatically.
default: ^backport ([^ ]+)$
merge_commits:
description: >
Specifies how the action should deal with merge commits on the merged pull request.
When set to `fail` the backport fails when the action detects one or more merge commits.
When set to `skip` the action only cherry-picks non-merge commits, i.e. it ignores merge commits.
default: fail
pull_description:
description: >
Template used as description (i.e. body) in the pull requests created by this action.
Placeholders can be used to define variable values.
These are indicated by a dollar sign and curly braces (`${placeholder}`).
Please refer to this action's README for all available placeholders.
default: |-
# Description
Backport of #${pull_number} to `${target_branch}`.
pull_title:
description: >
Template used as the title in the pull requests created by this action.
Placeholders can be used to define variable values.
These are indicated by a dollar sign and curly braces (`${placeholder}`).
Please refer to this action's README for all available placeholders.
default: >-
[Backport ${target_branch}] ${pull_title}
source_pr_number:
description: >
Specifies the pull request (by its number) to backport, i.e. the source pull request.
When set, the action will backport the specified pull request to each target branch.
When not set, the action determines the source pull request from the event payload.
target_branches:
description: >
The action will backport the pull request to each specified target branch (space-delimited).
Note that the pull request's headref is excluded automatically.
Can be used in addition to backport labels.
By default, only backport labels are used to specify the target branches.
outputs:
created_pull_numbers:
description: >
Space-separated list containing the identifying number of each created pull request.
Or empty when the action created no pull requests.
For example, '123' or '123 124 125'.
was_successful:
description: >
Whether or not the changes could be backported successfully to all targets.
Either 'true' or 'false'.
was_successful_by_target:
description: >
Whether or not the changes could be backported successfully to all targets - broken down by target.
Follows the pattern '{{label}}=true|false'.
runs:
using: "node20"
main: "dist/index.js"
branding:
icon: "copy"
color: "yellow"