Skip to content

Commit c01a6ce

Browse files
authored
Update mergify to create backport with default options (#7814)
* Update mergify to create backport with default options * Backport active action
1 parent 6fd2cdd commit c01a6ce

File tree

2 files changed

+30
-52
lines changed

2 files changed

+30
-52
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: 8 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@ queue_rules:
1010
conditions:
1111
- check-success=buildkite/elastic-agent
1212
- check-success=CLA
13+
defaults:
14+
actions:
15+
backport:
16+
title: "[{{ destination_branch }}] (backport #{{ number }}) {{ title }}"
17+
assignees:
18+
- "{{ author }}"
19+
labels:
20+
- "backport"
1321
pull_request_rules:
1422
- name: self-assign PRs
1523
conditions:
@@ -398,55 +406,3 @@ pull_request_rules:
398406
labels:
399407
- "backport"
400408
title: "[{{ destination_branch }}](backport #{{ number }}) {{ title }}"
401-
402-
- name: backport patches to all active minor branches for the 8 major.
403-
conditions:
404-
- merged
405-
- label=backport-active-8
406-
actions:
407-
backport:
408-
assignees:
409-
- "{{ author }}"
410-
# NOTE: this list needs to be changed when a new minor branch is created
411-
# or an existing minor branch reached EOL.
412-
branches:
413-
- "8.x"
414-
- "8.18"
415-
- "8.17"
416-
labels:
417-
- "backport"
418-
title: "[{{ destination_branch }}](backport #{{ number }}) {{ title }}"
419-
- name: backport patches to all active minor branches for the 9 major.
420-
conditions:
421-
- merged
422-
- label=backport-active-9
423-
actions:
424-
backport:
425-
assignees:
426-
- "{{ author }}"
427-
# NOTE: this list needs to be changed when a new minor branch is created
428-
# or an existing minor branch reached EOL.
429-
branches:
430-
- "9.0"
431-
labels:
432-
- "backport"
433-
title: "[{{ destination_branch }}](backport #{{ number }}) {{ title }}"
434-
- name: backport patches to all active branches
435-
conditions:
436-
- merged
437-
- label=backport-active-all
438-
actions:
439-
backport:
440-
assignees:
441-
- "{{ author }}"
442-
# NOTE: this list needs to be changed when a new minor branch is created
443-
# or an existing release branch reached EOL.
444-
branches:
445-
- "9.0"
446-
- "8.18"
447-
- "8.17"
448-
- "8.x"
449-
- "7.17"
450-
labels:
451-
- "backport"
452-
title: "[{{ destination_branch }}](backport #{{ number }}) {{ title }}"

0 commit comments

Comments
 (0)