From 3d8ec6e1f4cb6cc567492851e94e2c60458472e1 Mon Sep 17 00:00:00 2001 From: Andrea Lamparelli Date: Fri, 5 May 2023 09:56:18 +0200 Subject: [PATCH] [BXMSPROD-2012] backport pr-backporting workflow to legacy branch (#2972) --- .github/workflows/pr-backporting.yml | 38 ++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/pr-backporting.yml diff --git a/.github/workflows/pr-backporting.yml b/.github/workflows/pr-backporting.yml new file mode 100644 index 00000000000..36423239eab --- /dev/null +++ b/.github/workflows/pr-backporting.yml @@ -0,0 +1,38 @@ +name: Pull Request Backporting + +on: + pull_request_target: + types: [closed, labeled] + +env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + +jobs: + compute-targets: + if: ${{ github.event.pull_request.state == 'closed' && github.event.pull_request.merged }} + runs-on: ubuntu-latest + outputs: + target-branches: ${{ steps.set-targets.outputs.targets }} + env: + LABELS: ${{ toJSON(github.event.pull_request.labels) }} + steps: + - name: Set target branches + id: set-targets + uses: kiegroup/kie-ci/.ci/actions/parse-labels@main + with: + labels: ${LABELS} + + backporting: + if: ${{ github.event.pull_request.state == 'closed' && github.event.pull_request.merged && needs.compute-targets.outputs.target-branches != '[]' }} + name: "[${{ matrix.target-branch }}] - Backporting" + runs-on: ubuntu-latest + needs: compute-targets + strategy: + matrix: + target-branch: ${{ fromJSON(needs.compute-targets.outputs.target-branches) }} + fail-fast: false + steps: + - name: Backporting + uses: kiegroup/kie-ci/.ci/actions/backporting@main + with: + target-branch: ${{ matrix.target-branch }}