From 0f56f55b840801dc142a834774f21a219a8579f6 Mon Sep 17 00:00:00 2001 From: Wires77 Date: Wed, 16 Apr 2025 01:44:21 -0500 Subject: [PATCH 1/2] Create receiving workflow for backporting changes --- .github/workflows/backport_receive.yml | 28 ++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/backport_receive.yml diff --git a/.github/workflows/backport_receive.yml b/.github/workflows/backport_receive.yml new file mode 100644 index 0000000000..88695c9e9f --- /dev/null +++ b/.github/workflows/backport_receive.yml @@ -0,0 +1,28 @@ +name: Update code with code from PoB2 + +on: + repository_dispatch: + types: + - port-changes + +jobs: + apply-patch: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + ref: 'dev' + - name: Apply patch + run: | + curl -L ${{ github.event.client_payload.patch_url }} | git apply -v --index + - name: Create Pull Request + uses: peter-evans/create-pull-request@v5 + with: + title: "[pob2-port] ${{ github.event.client_payload.title }}" + branch: pob2-pr-${{ github.event.client_payload.id }} + body: | + ${{ github.event.client_payload.msg }} + author: ${{ github.event.client_payload.name || github.event.client_payload.user }} <${{ github.event.client_payload.user }}@users.noreply.github.com> + commit-message: ${{ github.event.client_payload.msg }} + labels: ${{ github.event.client_payload.labels }} From 5840722445c654db7eb402a55dcffe29539b99d9 Mon Sep 17 00:00:00 2001 From: Wires77 Date: Wed, 16 Apr 2025 01:47:00 -0500 Subject: [PATCH 2/2] Create backport.yml --- .github/workflows/backport.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/backport.yml diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml new file mode 100644 index 0000000000..40823c2348 --- /dev/null +++ b/.github/workflows/backport.yml @@ -0,0 +1,22 @@ +name: Port changes to PoB2 + +on: + pull_request: + types: [closed] + +env: + LABEL_STRING: ${{ join(github.event.pull_request.labels.*.name, ',') }} + +jobs: + backport: + if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'pob2') + runs-on: ubuntu-latest + steps: + - name: Notify PathOfBuilding repo + uses: peter-evans/repository-dispatch@v3 + with: + token: ${{ secrets.WIRES77_PAT }} + repository: ${{ github.repository_owner }}/PathOfBuilding-PoE2 + event-type: port-changes + client-payload: '{"patch_url": "${{ github.event.pull_request.patch_url }}", "msg": "Apply changes from ${{ github.event.pull_request.html_url }}", "id": ${{ github.event.pull_request.number }}, "title": "${{ github.event.pull_request.title }}", "labels": "${{ env.LABEL_STRING }}", "name": "${{ github.event.pull_request.user.name }}", "user": "${{ github.event.pull_request.user.login }}"}' +