Skip to content

Commit e3afa5b

Browse files
branchvincentneersighted
authored andcommitted
feat: add action to backport commits to release branches
1 parent ee05f06 commit e3afa5b

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

.github/workflows/backport.yaml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Backport
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- closed
7+
- labeled
8+
9+
jobs:
10+
backport:
11+
name: Backport
12+
runs-on: ubuntu-latest
13+
# Only react to merged PRs for security reasons.
14+
# See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target.
15+
if: >
16+
github.event.pull_request.merged
17+
&& (
18+
github.event.action == 'closed'
19+
|| (
20+
github.event.action == 'labeled'
21+
&& contains(github.event.label.name, 'backport')
22+
)
23+
)
24+
steps:
25+
- uses: tibdex/backport@v2
26+
with:
27+
github_token: ${{ secrets.GITHUB_TOKEN }}
28+
title_template: "[<%= base %>] <%= title %>"
29+
label_pattern: "^backport/(?<base>([^ ]+))$"

0 commit comments

Comments
 (0)