From 9903f024073cf87dc8b2e2834f6a10af00919a48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Louv-Jansen?= Date: Wed, 17 Mar 2021 08:31:27 +0100 Subject: [PATCH 1/2] [Github Action] Add `backport` workflow --- .github/workflows/backport.yml | 39 ++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/backport.yml diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml new file mode 100644 index 000000000000..9445d0226572 --- /dev/null +++ b/.github/workflows/backport.yml @@ -0,0 +1,39 @@ +on: + pull_request_target: + branches: + - master + types: + - labeled + - closed + +jobs: + backport: + name: Backport PR + if: | + github.event.pull_request.merged == true + && contains(github.event.pull_request.labels.*.name, 'auto-backport') + && ( + (github.event.action == 'labeled' && github.event.label.name == 'auto-backport') + || (github.event.action == 'closed') + ) + runs-on: ubuntu-latest + steps: + - name: Checkout Actions + uses: actions/checkout@v2 + with: + repository: 'elastic/kibana-github-actions' + ref: main + path: ./actions + + - name: Install Actions + run: npm install --production --prefix ./actions + + - name: Run Backport + uses: ./actions/backport + with: + github_token: ${{secrets.KIBANAMACHINE_TOKEN}} + commit_user: kibanamachine + commit_email: 42973632+kibanamachine@users.noreply.github.com + auto_merge: 'true' + auto_merge_method: 'squash' + manual_backport_command_template: 'node scripts/backport --pr %pullNumber%' From b232314892204e324df15a2df357eb8bb447beee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Louv-Jansen?= Date: Wed, 17 Mar 2021 08:54:51 +0100 Subject: [PATCH 2/2] Update backport.yml --- .github/workflows/backport.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index 9445d0226572..454351cf1226 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -31,9 +31,9 @@ jobs: - name: Run Backport uses: ./actions/backport with: - github_token: ${{secrets.KIBANAMACHINE_TOKEN}} + github_token: ${{secrets.BACKPORT_ACTION_TOKEN}} commit_user: kibanamachine - commit_email: 42973632+kibanamachine@users.noreply.github.com + commit_email: beats-backport-action@users.noreply.github.com auto_merge: 'true' auto_merge_method: 'squash' manual_backport_command_template: 'node scripts/backport --pr %pullNumber%'