Skip to content

Commit d197f15

Browse files
authored
Create workflows for porting changes (#8596)
* Create receiving workflow for backporting changes * Create backport.yml
1 parent 63d802c commit d197f15

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-0
lines changed

.github/workflows/backport.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Port changes to PoB2
2+
3+
on:
4+
pull_request:
5+
types: [closed]
6+
7+
env:
8+
LABEL_STRING: ${{ join(github.event.pull_request.labels.*.name, ',') }}
9+
10+
jobs:
11+
backport:
12+
if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'pob2')
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Notify PathOfBuilding repo
16+
uses: peter-evans/repository-dispatch@v3
17+
with:
18+
token: ${{ secrets.WIRES77_PAT }}
19+
repository: ${{ github.repository_owner }}/PathOfBuilding-PoE2
20+
event-type: port-changes
21+
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 }}"}'
22+
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Update code with code from PoB2
2+
3+
on:
4+
repository_dispatch:
5+
types:
6+
- port-changes
7+
8+
jobs:
9+
apply-patch:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v3
14+
with:
15+
ref: 'dev'
16+
- name: Apply patch
17+
run: |
18+
curl -L ${{ github.event.client_payload.patch_url }} | git apply -v --index
19+
- name: Create Pull Request
20+
uses: peter-evans/create-pull-request@v5
21+
with:
22+
title: "[pob2-port] ${{ github.event.client_payload.title }}"
23+
branch: pob2-pr-${{ github.event.client_payload.id }}
24+
body: |
25+
${{ github.event.client_payload.msg }}
26+
author: ${{ github.event.client_payload.name || github.event.client_payload.user }} <${{ github.event.client_payload.user }}@users.noreply.github.com>
27+
commit-message: ${{ github.event.client_payload.msg }}
28+
labels: ${{ github.event.client_payload.labels }}

0 commit comments

Comments
 (0)