Skip to content

Commit cd05a48

Browse files
committedMay 29, 2024
actions: backport: Update action and run only if the org PR is merged
This is taken directly from: zephyrproject-rtos/zephyr@260d054 Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
1 parent ecbab03 commit cd05a48

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed
 

‎.github/workflows/backport.yml

+18-3
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,28 @@ on:
44
types:
55
- closed
66
- labeled
7+
branches:
8+
- main
79

810
jobs:
911
backport:
10-
runs-on: ubuntu-20.04
1112
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+
)
1225
steps:
1326
- name: Backport
14-
uses: zephyrproject-rtos/action-backport@v1.1.99
27+
uses: zephyrproject-rtos/action-backport@v2.0.3-3
1528
with:
16-
github_token: ${{ secrets.GITHUB_TOKEN }}
29+
github_token: ${{ secrets.NCS_GITHUB_TOKEN }}
30+
issue_labels: Backport
31+
labels_template: '["Backport"]'

0 commit comments

Comments
 (0)