aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/ircbot/install-webhook.sh
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/ircbot/install-webhook.sh')
-rwxr-xr-xcontrib/ircbot/install-webhook.sh33
1 files changed, 30 insertions, 3 deletions
diff --git a/contrib/ircbot/install-webhook.sh b/contrib/ircbot/install-webhook.sh
index 1f8f12dd..d4db101c 100755
--- a/contrib/ircbot/install-webhook.sh
+++ b/contrib/ircbot/install-webhook.sh
@@ -2,9 +2,10 @@
set -xe
-hut lists webhook create "https://lists.sr.ht/~rjarry/aerc-devel" \
- --stdin -e patchset_received \
- -u https://bot.diabeteman.com/sourcehut/ <<EOF
+list="${1:-https://lists.sr.ht/~rjarry/aerc-devel}"
+url="${2:-https://bot.diabeteman.com/sourcehut/}"
+
+hut lists webhook create "$list" --stdin -e patchset_received -u "$url" <<EOF
query {
webhook {
uuid
@@ -38,3 +39,29 @@ query {
}
}
EOF
+
+hut lists webhook create "$list" --stdin -e email_received -u "$url" <<EOF
+query {
+ webhook {
+ uuid
+ event
+ date
+ ... on EmailEvent {
+ email {
+ id
+ subject
+ patchset_update: header(want: "X-Sourcehut-Patchset-Update")
+ references: header(want: "References")
+ list {
+ name
+ owner {
+ ... on User {
+ canonicalName
+ }
+ }
+ }
+ }
+ }
+ }
+}
+EOF