From 525bdc37718b4d1a48910f7e6b9acf1005078fac Mon Sep 17 00:00:00 2001
From: Paul Holzinger <pholzing@redhat.com>
Date: Thu, 27 Jan 2022 17:26:14 +0100
Subject: [PATCH] github: label issues based on os

We get a lot of issues for podman-remote on macos. Since the fact that
this is a remote client is often overlooked by us lets add windows, macos
and remote label automatically based on a regex which should match the
output of podman version.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
---
 .github/issue-labeler.yml           | 10 ++++++++++
 .github/workflows/issue-labeler.yml | 15 +++++++++++++++
 2 files changed, 25 insertions(+)
 create mode 100644 .github/issue-labeler.yml
 create mode 100644 .github/workflows/issue-labeler.yml

diff --git a/.github/issue-labeler.yml b/.github/issue-labeler.yml
new file mode 100644
index 0000000000..fb8ca2a321
--- /dev/null
+++ b/.github/issue-labeler.yml
@@ -0,0 +1,10 @@
+# List of labels which should be assigned to issues based on a regex
+windows:
+  - 'Os\/Arch:\s*windows'
+
+macos:
+  - 'Os\/Arch:\s*darwin'
+
+remote:
+  # podman-remote version prints Client:\nVersion:...
+  - 'Client:\sVersion:'
diff --git a/.github/workflows/issue-labeler.yml b/.github/workflows/issue-labeler.yml
new file mode 100644
index 0000000000..ee9785d231
--- /dev/null
+++ b/.github/workflows/issue-labeler.yml
@@ -0,0 +1,15 @@
+name: "Issue Labeler"
+on:
+  issues:
+    types: [opened, edited]
+
+jobs:
+  triage:
+    runs-on: ubuntu-latest
+    steps:
+    - uses: github/issue-labeler@v2.0
+      with:
+        repo-token: "${{ secrets.GITHUB_TOKEN }}"
+        configuration-path: .github/issue-labeler.yml
+        not-before: 2022-01-27T00:00:00Z
+        enable-versioned-regex: 0