Create workflows for porting changes (#8596)

* Create receiving workflow for backporting changes

* Create backport.yml
This commit is contained in:
Wires77
2025-04-18 08:00:12 -05:00
committed by GitHub
parent 63d802cba7
commit d197f15b4d
2 changed files with 50 additions and 0 deletions

22
.github/workflows/backport.yml vendored Normal file
View File

@@ -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 }}"}'

28
.github/workflows/backport_receive.yml vendored Normal file
View File

@@ -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 }}