<?php
function rg_wh_http_generic_add_form_pre($db, &$rg)
{
if (!isset($rg['wh']['description']))
$rg['wh']['description'] = 'Matrix.org integration';
$a = $rg['wh']['idata'];
$a['itype'] = 2;
$a['show_sign_key'] = 1;
$a['url_example'] = 'https://my_server_dot_tld/hook.cgi?branch=##branch##';
if (!isset($a['events']))
$a['events'] = 'P';
if (!isset($a['content_type']))
$a['content_type'] = 'application/json';
if (!isset($a['custom_body']))
$a['custom_body'] = '{' . "\n"
. '"channel": "#rocketgit-##branch##",' . "\n"
. '"username": "RocketGit robot (hook ##hook_id##)",' . "\n"
. '"text": "Repo ##repo##, branch ##branch## pushed: <##commit_url##> (ip ##ip##)",' . "\n"
. '"icon_emoji": ":ghost:"' . "\n"
. '}';
$rg['wh']['idata'] = $a;
}
$cb = array(
'add_form_pre' => 'rg_wh_http_generic_add_form_pre'
);
rg_wh_register_subtype('http', 'generic', 'Generic', $cb);
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"
Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/rocketgit
Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/rocketgit
You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a
pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master