Skip to content

Commit 8c4e65b

Browse files
author
LocalIdentity
committed
Update PoB 2 backport
Now tries to do a 3way merge if possible and falls back to reject when failing Also adds the PR # to the run name
1 parent 579fe0b commit 8c4e65b

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

.github/workflows/backport_receive.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Update code with code from PoB2
2-
run-name: ${{ github.event.client_payload.title }}
2+
run-name: "PR #${{ github.event.client_payload.id }} — ${{ github.event.client_payload.title }}"
33

44
on:
55
repository_dispatch:
@@ -15,17 +15,22 @@ jobs:
1515
with:
1616
ref: 'dev'
1717
- name: Apply patch
18-
continue-on-error: true
1918
run: |
20-
curl -L ${{ github.event.client_payload.patch_url }} | patch -p1 --merge --verbose -f -l --no-backup-if-mismatch
19+
# Download patch first to avoid broken pipes if apply exits early
20+
PATCH_FILE=$(mktemp)
21+
curl -L ${{ github.event.client_payload.patch_url }} -o "$PATCH_FILE"
22+
if ! git apply -v --3way --ignore-whitespace --index "$PATCH_FILE"; then
23+
echo "3-way apply failed, retrying with --reject"
24+
git apply -v --reject --ignore-whitespace --index "$PATCH_FILE" || true
25+
fi
2126
- name: Create Pull Request
2227
uses: peter-evans/create-pull-request@v5
2328
with:
2429
title: "[pob2-port] ${{ github.event.client_payload.title }}"
2530
branch: pob2-pr-${{ github.event.client_payload.id }}
2631
body: |
2732
${{ github.event.client_payload.msg }}
28-
committer: ${{ github.event.client_payload.name || github.event.client_payload.user }} <${{ github.event.client_payload.user }}@users.noreply.github.com>
2933
author: ${{ github.event.client_payload.name || github.event.client_payload.user }} <${{ github.event.client_payload.user }}@users.noreply.github.com>
34+
committer: ${{ github.event.client_payload.name || github.event.client_payload.user }} <${{ github.event.client_payload.user }}@users.noreply.github.com>
3035
commit-message: ${{ github.event.client_payload.msg }}
31-
labels: ${{ github.event.client_payload.labels }}
36+
labels: ${{ github.event.client_payload.labels }}

0 commit comments

Comments
 (0)