From bb16e6b2ff4cf4042d137078c3b5186e4cf9d349 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 28 Feb 2023 21:07:34 +0000 Subject: [PATCH] Update backport workflow (#536) Signed-off-by: Matt Provost (cherry picked from commit e8fcf75359e445e352f6259f8f8e0a4f54801272) Signed-off-by: github-actions[bot] --- .github/workflows/backport.yml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index f515b254b8..0ba694cbf2 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -12,6 +12,17 @@ jobs: contents: write pull-requests: write name: Backport + # Only react to merged PRs for security reasons. + # See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target. + if: > + github.event.pull_request.merged + && ( + github.event.action == 'closed' + || ( + github.event.action == 'labeled' + && contains(github.event.label.name, 'backport') + ) + ) steps: - name: GitHub App token id: github_app_token @@ -22,10 +33,9 @@ jobs: # opensearch-trigger-bot installation ID installation_id: 22958780 - # Using fork of https://github.com/tibdex/backport - # https://github.com/tibdex/backport/pull/81 - name: Backport - uses: VachaShah/backport@v1.1.4 + uses: VachaShah/backport@v2.1.0 with: github_token: ${{ steps.github_app_token.outputs.token }} - branch_name: backport/backport-${{ github.event.number }} + head_template: backport/backport-<%= number %>-to-<%= base %> + files_to_skip: "CHANGELOG.md"