From 0716c53d7eae6da49379fd22d4b8e21330351b1d Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Thu, 25 Jun 2026 15:26:10 -0400 Subject: [PATCH] Onboard new backport-pr re-usable github workflow (flow-framework) - Replace old backport workflow with reusable workflow from opensearch-build - Remove obsolete backport-related workflows Signed-off-by: Peter Zhu --- .../workflows/add-backport-label.yml.disabled | 14 ------- .github/workflows/backport.yml | 40 +++---------------- 2 files changed, 6 insertions(+), 48 deletions(-) delete mode 100644 .github/workflows/add-backport-label.yml.disabled diff --git a/.github/workflows/add-backport-label.yml.disabled b/.github/workflows/add-backport-label.yml.disabled deleted file mode 100644 index 89eca1976..000000000 --- a/.github/workflows/add-backport-label.yml.disabled +++ /dev/null @@ -1,14 +0,0 @@ -name: Add Backport Label -on: - pull_request_target: - branches: main - types: opened - -jobs: - add_labels: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions-ecosystem/action-add-labels@v1 - with: - labels: backport 2.x diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index 05bbf445e..eefa61f71 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -1,40 +1,12 @@ +--- name: Backport on: pull_request_target: - types: - - closed - - labeled + types: [closed, labeled] jobs: backport: - name: Backport - runs-on: ubuntu-latest - # 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') - ) - ) - permissions: - contents: write - pull-requests: write - steps: - - name: GitHub App token - id: github_app_token - uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2 - with: - app_id: ${{ secrets.APP_ID }} - private_key: ${{ secrets.APP_PRIVATE_KEY }} - installation_id: 22958780 - - - name: Backport - uses: VachaShah/backport@142d3b8a8c70dc54db515e653e5ed3c3fac64100 # v2.2.0 - with: - github_token: ${{ steps.github_app_token.outputs.token }} - head_template: backport/backport-<%= number %>-to-<%= base %> - failure_labels: backport-failed + if: github.repository == 'opensearch-project/flow-framework' + uses: opensearch-project/opensearch-build/.github/workflows/backport-pr.yml@main + secrets: + OPENSEARCH_CI_BOT_TOKEN: ${{ secrets.OPENSEARCH_CI_BOT_TOKEN }}