From efb513b3463b55605b6c3b1e9e7eaf8a894533c4 Mon Sep 17 00:00:00 2001 From: ev1yehor <146825775+ev1yehor@users.noreply.github.com> Date: Thu, 10 Apr 2025 17:53:16 +0300 Subject: [PATCH] New way of backporting to active branches using new github action --- .github/workflows/backport-active.yml | 22 ++++++++++++++++++++++ .mergify.yml | 14 ++++++++++++++ 2 files changed, 36 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 0000000000..a0f563fea9 --- /dev/null +++ b/.github/workflows/backport-active.yml @@ -0,0 +1,22 @@ +name: Backport to active branches + +on: + pull_request_target: + types: [closed] + 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 + if: | + github.event.pull_request.merged == true && + contains(toJSON(github.event.pull_request.labels.*.name), 'backport-active-') + runs-on: ubuntu-latest + + steps: + - uses: elastic/oblt-actions/github/backport-active@v1 diff --git a/.mergify.yml b/.mergify.yml index b807a57905..d252aadf51 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -1,3 +1,17 @@ +commands_restrictions: + backport: + conditions: + - or: + - sender-permission>=write + - sender=github-actions[bot] +defaults: + actions: + backport: + title: "[{{ destination_branch }}] (backport #{{ number }}) {{ title }}" + assignees: + - "{{ author }}" + labels: + - "backport" pull_request_rules: - name: ask to resolve conflict conditions: