File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,8 @@ class Geth::Plugin::Info {
14
14
" Source at https://github.com/perl6/geth "
15
15
~ " To add repo, add an 'application/json' webhook on GitHub "
16
16
~ " pointing it to http://geth.perl6.party/?chan=#perl6 and choose "
17
- ~ " 'Send me everything' for events to send" ;
17
+ ~ " 'Send me everything' for events to send | use `ver URL to commit` "
18
+ ~ " to fetch version bump changes" ;
18
19
}
19
20
}
20
21
Original file line number Diff line number Diff line change @@ -4,13 +4,32 @@ unit class Geth::Plugin::GitHub is IRC::Client::Plugin;
4
4
use IRC::TextColor;
5
5
use Geth::Config;
6
6
use Geth::GitHub::Hooks;
7
+ use Geth::GitHub::Hooks::Preprocessor;
8
+
7
9
has $ . host is required ;
8
10
has $ . port is required ;
9
11
10
12
constant & Δ = & irc-style-text ;
11
13
constant THROTTLE_LINES_UNTHROTTLED_MAX = 5 ;
12
14
constant THROTTLE_SLEEP = 2 ;
13
15
constant THROTTLE_COOLDOWN = 8 ;
16
+ constant $ NQP_API_URL = ' https://api.github.com/repos/perl6/nqp' ;
17
+ constant $ RAKUDO_API_URL = ' https://api.github.com/repos/rakudo/rakudo' ;
18
+ constant $ NQP_URL = ' https://github.com/perl6/nqp' ;
19
+ constant $ MOAR_URL = ' https://github.com/MoarVM/MoarVM' ;
20
+
21
+ method irc-to-me (
22
+ $ where /^ ' ver' \s+ ' https://github.com/' <-[/] >+ ' /'
23
+ $ < repo > = <-[/] >+ ' /commit/' $ < sha > = \S+ $/
24
+ ) {
25
+ Geth::GitHub::Hooks::Preprocessor. new . fetch-version-bump: | (
26
+ $ < repo > eq ' rakudo'
27
+ ?? (" $ RAKUDO_API_URL /commits/$ < sha > " , $ NQP_URL )
28
+ !! (" $ NQP_API_URL /commits/$ < sha > " , $ MOAR_URL )
29
+ )
30
+ andthen " version bump brought in these changes: $ _"
31
+ orelse " Failed to fetch version bump info because reasons" ;
32
+ }
14
33
15
34
method irc-started {
16
35
start react {
You can’t perform that action at this time.
0 commit comments