PR #23823 opened by Timo Rothenpieler (BtbN)
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/23823
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/23823.patch

Unfortunately, there isn't really a great way to test this prior to merging, 
since it relies on the capabilities of the pr-target event to get access to 
secrets.
I've modified the backporting action a bit, so it can open PRs from a fork, 
instead of littering branches into the main repo.
Not sure if that part works at all.

This action is being used for Forgejo itself, you can see it doing things for 
example here:
https://codeberg.org/forgejo/forgejo/pulls/13406
https://codeberg.org/forgejo/forgejo/pulls/13443


>From b20c439d81b825e8a5583cade504301e2f09b76b Mon Sep 17 00:00:00 2001
From: Timo Rothenpieler <[email protected]>
Date: Wed, 15 Jul 2026 22:59:11 +0200
Subject: [PATCH] forgejo/workflows: add workflow for automatic backport PRs
 via labels

---
 .forgejo/workflows/backports.yml | 33 ++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)
 create mode 100644 .forgejo/workflows/backports.yml

diff --git a/.forgejo/workflows/backports.yml b/.forgejo/workflows/backports.yml
new file mode 100644
index 0000000000..9a07164cc2
--- /dev/null
+++ b/.forgejo/workflows/backports.yml
@@ -0,0 +1,33 @@
+# SPDX-License-Identifier: MIT
+
+name: Pull Request Backporting
+
+on:
+  pull_request_target:
+    types:
+      - closed
+      - labeled
+
+jobs:
+  backporting:
+    name: Backporting
+    if: >
+      forgejo.event.pull_request.merged && (
+        (forgejo.event.action == 'closed' && 
contains(forgejo.event.pull_request.labels.*.name, 'backport/')) ||
+        (forgejo.event.action == 'labeled' && 
contains(forgejo.event.label.name, 'backport/'))
+      )
+    runs-on: utilities
+    steps:
+      - uses: actions/git-backporting@main
+        with:
+          target-branch-pattern: "^backport/(?<target>(.+))$"
+          strategy: ort
+          strategy-option: find-renames
+          cherry-pick-options: -x
+          bp-repo: ffmpeg-devel/FFmpeg
+          auth: ${{ secrets.BACKPORT_TOKEN }}
+          pull-request: ${{ forgejo.event.pull_request.url }}
+          auto-no-squash: true
+          enable-err-notification: true
+          git-user: ffmpeg-devel
+          git-email: [email protected]
-- 
2.52.0

_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to