ci: add PR labeler workflow
authorGeorge Sapkin <[email protected]>
Fri, 7 Nov 2025 21:21:18 +0000 (23:21 +0200)
committerJosef Schlehofer <[email protected]>
Wed, 3 Dec 2025 10:20:05 +0000 (11:20 +0100)
Label based on target release branch. Labels must be manually defined to
avoid giving the action unnecessary permissions. Release labels must be
defined in the config after each release is forked.

Signed-off-by: George Sapkin <[email protected]>
.github/labeler.yml [new file with mode: 0644]
.github/workflows/labeler.yml [new file with mode: 0644]

diff --git a/.github/labeler.yml b/.github/labeler.yml
new file mode 100644 (file)
index 0000000..749cf3e
--- /dev/null
@@ -0,0 +1,7 @@
+# branches
+"OpenWrt 23.05 (end of support)":
+- base-branch:
+  - "openwrt-23.05"
+"OpenWrt 24.10":
+- base-branch:
+  - "openwrt-24.10"
diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml
new file mode 100644 (file)
index 0000000..29396df
--- /dev/null
@@ -0,0 +1,20 @@
+name: 'Pull Request Labeler'
+on:
+  - pull_request_target
+
+permissions:
+  contents: read
+
+jobs:
+  labeler:
+    permissions:
+      contents: read
+      pull-requests: write
+
+    name: Pull Request Labeler
+    runs-on: ubuntu-slim
+    steps:
+      - uses: actions/labeler@v6
+        with:
+          repo-token: '${{ secrets.GITHUB_TOKEN }}'
+          sync-labels: true