Skip to content

Commit e406849

Browse files
carlescufirlubos
authored andcommitted
[nrf noup] workflows: Add a backport workflow
Enable backporting of PRs. Signed-off-by: Carles Cufi <[email protected]> (cherry picked from commit b1376c6)
1 parent be6d73e commit e406849

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

.github/workflows/backport.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Backport
2+
on:
3+
pull_request_target:
4+
types:
5+
- closed
6+
- labeled
7+
branches:
8+
- main
9+
10+
jobs:
11+
backport:
12+
name: Backport
13+
runs-on: ubuntu-22.04
14+
# Only react to merged PRs for security reasons.
15+
# See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target.
16+
if: >
17+
github.event.pull_request.merged &&
18+
(
19+
github.event.action == 'closed' ||
20+
(
21+
github.event.action == 'labeled' &&
22+
contains(github.event.label.name, 'backport')
23+
)
24+
)
25+
steps:
26+
- name: Backport
27+
uses: zephyrproject-rtos/[email protected]
28+
with:
29+
github_token: ${{ secrets.NCS_GITHUB_TOKEN }}
30+
issue_labels: Backport
31+
labels_template: '["Backport"]'

0 commit comments

Comments
 (0)