Skip to content

Open-source AI teammates in Slack, Teams, Discord, Telegram and Mattermost. Self-host it, with any agent harness and any model.

ci: notify the Switch issue manager when an issue is opened (#470)

Louis Amaudruz990200ddda53
diff --git a/.github/workflows/dispatch-issue-to-switch.yml b/.github/workflows/dispatch-issue-to-switch.yml
new file mode 100644
index 000000000..9083e85cc
--- /dev/null
+++ b/.github/workflows/dispatch-issue-to-switch.yml
@@ -0,0 +1,40 @@
+name: dispatch-issue-to-switch
+
+# Hands every newly opened issue to the Switch issue manager, which creates a
+# dedicated room (lead + coder + reviewer) to work it.
+#
+# Only the issue number, title and URL are sent. The issue body is deliberately
+# not included: the manager fetches it itself, so untrusted text from the issue
+# never arrives as part of the instruction that triggers the run.
+
+on:
+ issues:
+ types: [opened]
+
+permissions:
+ contents: read
+
+jobs:
+ notify:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Hand the issue to the issue manager
+ env:
+ WEBHOOK: ${{ secrets.DISCORD_HUB_WEBHOOK }}
+ NUMBER: ${{ github.event.issue.number }}
+ TITLE: ${{ github.event.issue.title }}
+ URL: ${{ github.event.issue.html_url }}
+ run: |
+ if [ -z "$WEBHOOK" ]; then
+ echo "DISCORD_HUB_WEBHOOK is not set; nothing to notify." >&2
+ exit 1
+ fi
+ payload=$(jq -n \
+ --arg n "$NUMBER" \
+ --arg t "$TITLE" \
+ --arg u "$URL" \
+ '{
+ content: ("<@&1549349717379514370> Please handle issue #" + $n + ": " + $t + "\n" + $u),
+ allowed_mentions: { parse: ["roles"] }
+ }')
+ curl -sS -f -X POST -H "Content-Type: application/json" -d "$payload" "$WEBHOOK"