From 00643e8b275c0fec9533b7f86802573cd97743a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aar=C3=B3n=20Garc=C3=ADa=20Herv=C3=A1s?= Date: Tue, 2 Apr 2024 00:45:12 +0200 Subject: [PATCH] [core] Automate cherry-pick of PRs from `next` -> `master` --- .../workflows/cherry-pick-next-to-master.yml | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/cherry-pick-next-to-master.yml diff --git a/.github/workflows/cherry-pick-next-to-master.yml b/.github/workflows/cherry-pick-next-to-master.yml new file mode 100644 index 00000000000000..50b64c79b8d014 --- /dev/null +++ b/.github/workflows/cherry-pick-next-to-master.yml @@ -0,0 +1,34 @@ +name: Cherry pick next to master + +on: + pull_request_target: + branches: + - next + types: ['closed'] + +permissions: {} + +jobs: + cherry_pick_to_master: + runs-on: ubuntu-latest + name: Cherry pick into master + permissions: + pull-requests: write + contents: write + if: ${{ contains(github.event.pull_request.labels.*.name, 'needs cherry-pick') && github.event.pull_request.merged == true }} + steps: + - name: Checkout + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + with: + fetch-depth: 0 + - name: Cherry pick and create the new PR + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: carloscastrojumo/github-cherry-pick-action@a145da1b8142e752d3cbc11aaaa46a535690f0c5 # v1.0.9 + with: + branch: master + body: 'Cherry-pick of #{old_pull_request_id}' + cherry-pick-branch: ${{ format('cherry-pick-{0}', github.event.number) }} + title: '{old_title} (@${{ github.event.pull_request.user.login }})' + labels: | + cherry-pick