From 270d55dfb445d298734ae16f6b3290f9ad52da30 Mon Sep 17 00:00:00 2001
From: Ekaterina Gerasimova <ekaterinag@element.io>
Date: Tue, 9 Nov 2021 10:44:22 +0000
Subject: [PATCH] Actions: move Voice message issues to their board

Signed-off-by: Ekaterina Gerasimova <ekaterinag@element.io>
---
 .github/workflows/triage-move-labelled.yml | 23 ++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/.github/workflows/triage-move-labelled.yml b/.github/workflows/triage-move-labelled.yml
index 5f567e01ec..34b51b8119 100644
--- a/.github/workflows/triage-move-labelled.yml
+++ b/.github/workflows/triage-move-labelled.yml
@@ -78,3 +78,26 @@ jobs:
           PROJECT_ID: "PN_kwDOAM0swc1HvQ"
           GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }}
 
+  move_voice-message_issues:
+    name: Move A-Voice Messages to Voice message board
+    runs-on: ubuntu-latest
+    if: >
+        ${{
+        contains(github.event.issue.labels.*.name, 'A-Voice Messages') }}
+    steps:
+      - uses: octokit/graphql-action@v2.x
+        with:
+          headers: '{"GraphQL-Features": "projects_next_graphql"}'
+          query: |
+            mutation add_to_project($projectid:String!,$contentid:String!) {
+              addProjectNextItem(input:{projectId:$projectid contentId:$contentid}) {
+                projectNextItem {
+                  id
+                }
+              }
+            }
+          projectid: ${{ env.PROJECT_ID }}
+          contentid: ${{ github.event.issue.node_id }}
+        env:
+          PROJECT_ID: "PN_kwDOAM0swc2KCw"
+          GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }}