From 40a88e07d12939401181b24342692fd102010b4b Mon Sep 17 00:00:00 2001 From: Pepe Fagoaga Date: Wed, 7 Aug 2024 10:40:14 +0200 Subject: [PATCH] chore(backport): Automate all the things! (#4669) --- .backportrc.json | 14 ++++++++++++++ .github/workflows/backport.yml | 26 ++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 .backportrc.json create mode 100644 .github/workflows/backport.yml diff --git a/.backportrc.json b/.backportrc.json new file mode 100644 index 0000000000..80fbf346ee --- /dev/null +++ b/.backportrc.json @@ -0,0 +1,14 @@ +{ + "repoOwner": "prowler-cloud", + "repoName": "prowler", + "targetPRLabels": [ + "backport" + ], + "sourcePRLabels": [ + "was-backported" + ], + "copySourcePRLabels": false, + "copySourcePRReviewers": true, + "prTitle": "chore(backport): {{commitMessages}} backport for {{targetBranch}}", + "commitConflicts": true +} diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml new file mode 100644 index 0000000000..4e58479c84 --- /dev/null +++ b/.github/workflows/backport.yml @@ -0,0 +1,26 @@ +name: Automatic Backport + +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, 'backport')) + runs-on: ubuntu-latest + steps: + - name: Backport Action + uses: sorenlouv/backport-github-action@v9.5.1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + auto_backport_label_prefix: backport-to- + + - name: Info log + if: ${{ success() }} + run: cat ~/.backport/backport.info.log + + - name: Debug log + if: ${{ failure() }} + run: cat ~/.backport/backport.debug.log