Skip to content

Commit 67c6a2e

Browse files
v1vmergify[bot]
authored andcommitted
github-actions: support backport labels after being merged (#367)
(cherry picked from commit 6f75475) # Conflicts: # .github/workflows/backport-active.yml
1 parent 35de332 commit 67c6a2e

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Backport to active branches
2+
3+
on:
4+
pull_request_target:
5+
types: [closed, labeled]
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+
# or has been added afterwards.
17+
if: |
18+
github.event.pull_request.merged == true &&
19+
(
20+
(github.event.action == 'closed' && contains(toJSON(github.event.pull_request.labels.*.name), 'backport-active-')) ||
21+
(github.event.action == 'labeled' && startsWith(github.event.label.name, 'backport-active-'))
22+
)
23+
runs-on: ubuntu-latest
24+
25+
steps:
26+
- uses: elastic/oblt-actions/github/backport-active@v1

0 commit comments

Comments
 (0)