notify: better documentation
This commit is contained in:
parent
5564c8cbfc
commit
2380f6694d
1 changed files with 33 additions and 0 deletions
|
@ -222,6 +222,18 @@ def index():
|
||||||
<td>default room</td>
|
<td>default room</td>
|
||||||
<td>!yREJWHUMJhGROiHbtu:fricloud.dk or #na-offtopic:rend.al</td>
|
<td>!yREJWHUMJhGROiHbtu:fricloud.dk or #na-offtopic:rend.al</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th scope="row">token</th>
|
||||||
|
<td>Authorization Token</td>
|
||||||
|
<td>empty</td>
|
||||||
|
<td>enable-trade-decide or enabletradedecide</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th scope="row">jq</th>
|
||||||
|
<td>jq filter</td>
|
||||||
|
<td>.</td>
|
||||||
|
<td>[.[].commits | .name ] | join("\\n")</td>
|
||||||
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<hr>
|
<hr>
|
||||||
|
@ -240,6 +252,27 @@ def index():
|
||||||
doCheck = false;
|
doCheck = false;
|
||||||
}} ''{script_example_with_token}'';
|
}} ''{script_example_with_token}'';
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
<hr>
|
||||||
|
<h2>Notes</h2>
|
||||||
|
<p>
|
||||||
|
<b>jq</b> is very powerful, and can easily be used to turn webhook data into useful information in a notification.
|
||||||
|
Just append your `jq=<url_encoded_query>`, to your notification URL, and then watch the magic.
|
||||||
|
Below is an example for doing it with Forgejo, when new commits are pushed.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<pre class="border"><code>(.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</code></pre>
|
||||||
|
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
<p class="fs-5">You've successfully loaded up the Bootstrap starter example. It includes <a href="https://getbootstrap.com/">Bootstrap 5</a> via the <a href="https://www.jsdelivr.com/package/npm/bootstrap">jsDelivr CDN</a> and includes an additional CSS and JS file for your own code.</p>
|
<p class="fs-5">You've successfully loaded up the Bootstrap starter example. It includes <a href="https://getbootstrap.com/">Bootstrap 5</a> via the <a href="https://www.jsdelivr.com/package/npm/bootstrap">jsDelivr CDN</a> and includes an additional CSS and JS file for your own code.</p>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue