From 67c6a2e7e9167f341b397979ac6aa217d139f35f Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Fri, 5 Sep 2025 10:01:27 +0200 Subject: [PATCH] github-actions: support backport labels after being merged (#367) (cherry picked from commit 6f754758bce0bd96b37564d9629242a54c3a6984) # Conflicts: # .github/workflows/backport-active.yml --- .github/workflows/backport-active.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/backport-active.yml diff --git a/.github/workflows/backport-active.yml b/.github/workflows/backport-active.yml new file mode 100644 index 00000000..a3f3d464 --- /dev/null +++ b/.github/workflows/backport-active.yml @@ -0,0 +1,26 @@ +name: Backport to active branches + +on: + pull_request_target: + types: [closed, labeled] + branches: + - main + +permissions: + pull-requests: write + contents: read + +jobs: + backport: + # Only run if the PR was merged (not just closed) and has one of the backport labels + # or has been added afterwards. + if: | + github.event.pull_request.merged == true && + ( + (github.event.action == 'closed' && contains(toJSON(github.event.pull_request.labels.*.name), 'backport-active-')) || + (github.event.action == 'labeled' && startsWith(github.event.label.name, 'backport-active-')) + ) + runs-on: ubuntu-latest + + steps: + - uses: elastic/oblt-actions/github/backport-active@v1