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: read the issue manager's Discord role id from a variable (#472)

Louis Amaudruz0f6481b59f24
diff --git a/.github/workflows/dispatch-issue-to-switch.yml b/.github/workflows/dispatch-issue-to-switch.yml
index 9083e85cc..a326b87e6 100644
--- a/.github/workflows/dispatch-issue-to-switch.yml
+++ b/.github/workflows/dispatch-issue-to-switch.yml
@@ -24,17 +24,23 @@ jobs:
NUMBER: ${{ github.event.issue.number }}
TITLE: ${{ github.event.issue.title }}
URL: ${{ github.event.issue.html_url }}
+ ROLE_ID: ${{ vars.SWITCH_MANAGER_ROLE_ID }}
run: |
if [ -z "$WEBHOOK" ]; then
echo "DISCORD_HUB_WEBHOOK is not set; nothing to notify." >&2
exit 1
fi
+ if [ -z "$ROLE_ID" ]; then
+ echo "SWITCH_MANAGER_ROLE_ID is not set; the mention would not address anyone." >&2
+ exit 1
+ fi
payload=$(jq -n \
--arg n "$NUMBER" \
--arg t "$TITLE" \
--arg u "$URL" \
+ --arg r "$ROLE_ID" \
'{
- content: ("<@&1549349717379514370> Please handle issue #" + $n + ": " + $t + "\n" + $u),
+ content: ("<@&" + $r + "> Please handle issue #" + $n + ": " + $t + "\n" + $u),
allowed_mentions: { parse: ["roles"] }
}')
curl -sS -f -X POST -H "Content-Type: application/json" -d "$payload" "$WEBHOOK"