diff --git a/machines/gerd/services/notify/app.py b/machines/gerd/services/notify/app.py index 88dcd9d..2de7532 100644 --- a/machines/gerd/services/notify/app.py +++ b/machines/gerd/services/notify/app.py @@ -222,6 +222,18 @@ def index(): default room !yREJWHUMJhGROiHbtu:fricloud.dk or #na-offtopic:rend.al + + token + Authorization Token + empty + enable-trade-decide or enabletradedecide + + + jq + jq filter + . + [.[].commits | .name ] | join("\\n") +
@@ -240,6 +252,27 @@ def index(): doCheck = false; }} ''{script_example_with_token}''; +
+

Notes

+

+ jq is very powerful, and can easily be used to turn webhook data into useful information in a notification. + Just append your `jq=`, to your notification URL, and then watch the magic. + Below is an example for doing it with Forgejo, when new commits are pushed. +

+ +
(.total_commits | tostring)
++ " commits pushed to "
++ .repository.full_name
++ "\n\n" +
+  # format commits
+  ([.commits.[]
+  | "- "
+    + (.message | gsub("[\n\t]"; ""))
+    + " (" + .author.name + ")" ]
+  | join("\n"))
++ "\n\n"
++ "Changes: " + .compare_url
+