Skip to content

Commit 9e9d79a

Browse files
authored
New way of backporting to active branches using new github action (#4887)
1 parent 5b98570 commit 9e9d79a

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Backport to active branches
2+
3+
on:
4+
pull_request_target:
5+
types: [closed]
6+
branches:
7+
- main
8+
9+
permissions:
10+
pull-requests: write
11+
contents: read
12+
13+
jobs:
14+
backport:
15+
# Only run if the PR was merged (not just closed) and has one of the backport labels
16+
if: |
17+
github.event.pull_request.merged == true &&
18+
contains(toJSON(github.event.pull_request.labels.*.name), 'backport-active-')
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- uses: elastic/oblt-actions/github/backport-active@v1

.mergify.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
commands_restrictions:
2+
backport:
3+
conditions:
4+
- or:
5+
- sender-permission>=write
6+
- sender=github-actions[bot]
7+
defaults:
8+
actions:
9+
backport:
10+
title: "[{{ destination_branch }}] (backport #{{ number }}) {{ title }}"
11+
assignees:
12+
- "{{ author }}"
13+
labels:
14+
- "backport"
115
pull_request_rules:
216
- name: ask to resolve conflict
317
conditions:

0 commit comments

Comments
 (0)