-
Notifications
You must be signed in to change notification settings - Fork 464
Feature: add webhook notification capability #724
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
Guts
wants to merge
15
commits into
isso-comments:master
Choose a base branch
from
Guts:notify/webhook
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
4c0f6ab
Add webhook
Guts d3aac38
Fix string formatting
Guts f5ed062
Fix string formatting
Guts ed1a93b
Fix flake8
Guts 28cce88
Make it compatible with Python 3.5 ?!
Guts 226d6f4
Add myself
Guts 432c02b
Add default webhook section
Guts 55c5f0d
Clean up and docstrings
Guts 2c96349
Handle HTTP errors
Guts 2562027
Add webhook template for Slack
Guts db0f069
Align tox dependencies with package
Guts 7efc711
Add requests as dependency
Guts 5403ce6
Remove unused var
Guts d0f2bda
Complete post data without template
Guts 83e0dae
Use json loads/dumps to prevent encoding aleas
Guts File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| { | ||
| "blocks": [ | ||
| { | ||
| "type": "header", | ||
| "text": { | ||
| "type": "plain_text", | ||
| "text": ":speech_balloon: New comment posted", | ||
| "emoji": true | ||
| } | ||
| }, | ||
| { | ||
| "type": "section", | ||
| "text": { | ||
| "type": "mrkdwn", | ||
| "text": "*Author:* $AUTHOR_NAME $AUTHOR_EMAIL $AUTHOR_WEBSITE" | ||
| } | ||
| }, | ||
| { | ||
| "type": "section", | ||
| "text": { | ||
| "type": "mrkdwn", | ||
| "text": "*IP:* $COMMENT_IP_ADDRESS" | ||
| } | ||
| }, | ||
| { | ||
| "type": "section", | ||
| "text": { | ||
| "type": "mrkdwn", | ||
| "text": "*Comment:*\n$COMMENT_TEXT" | ||
| } | ||
| }, | ||
| { | ||
| "type": "divider" | ||
| }, | ||
| { | ||
| "type": "actions", | ||
| "elements": [ | ||
| { | ||
| "type": "button", | ||
| "text": { | ||
| "type": "plain_text", | ||
| "emoji": true, | ||
| "text": ":eye-in-speech-bubble: View comment" | ||
| }, | ||
| "url": "$COMMENT_URL_VIEW" | ||
| }, | ||
| { | ||
| "type": "button", | ||
| "text": { | ||
| "type": "plain_text", | ||
| "emoji": true, | ||
| "text": ":white_check_mark: Approve" | ||
| }, | ||
| "style": "primary", | ||
| "url": "$COMMENT_URL_ACTIVATE" | ||
| }, | ||
| { | ||
| "type": "button", | ||
| "text": { | ||
| "type": "plain_text", | ||
| "emoji": true, | ||
| "text": ":wastebasket: Deny" | ||
| }, | ||
| "style": "danger", | ||
| "url": "$COMMENT_URL_DELETE" | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -271,3 +271,15 @@ base = | |
|
|
||
| # Limit the number of elements to return for each thread. | ||
| limit = 100 | ||
|
|
||
| [webhook] | ||
| # Isso can notify you on new comments via web hook. | ||
| # By default, it sends a POST data with new comment metadata: author, author email, author website, text, moderation URLs (activation, deletion, view). | ||
|
Guts marked this conversation as resolved.
|
||
| # It's also possible to add a JSON template (using Python string.Template) to customize the POST data. Useful to fit some tools abilities ike Slack, Matrix, Teams, etc. | ||
|
Guts marked this conversation as resolved.
|
||
| # An example for Slack with block builder is prodived in the contrib folder. | ||
|
|
||
| # webhook URL | ||
| url = | ||
|
|
||
| # path to the JSON template. Optional. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can users supply an absolute or relative path here? Please state so clearly. |
||
| template = | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't introduce another dependency needlessly, but I think I already commented on that.