6 use File::Slurp qw ( slurp );
10 my $token = slurp( File::HomeDir->my_home . "/.github-token" );
12 my $gh = Net::GitHub->new( # Net::GitHub::V3
13 access_token => $token
16 my @repos = $gh->repos->list_org('grml');
18 foreach my $repo (@repos) {
20 say "-" x length( $repo->{name} );
21 my @hooks = $gh->repos->hooks( 'grml', $repo->{name} );
23 foreach my $hook (@hooks) {
26 next unless $hook->{name} eq 'web';
27 next unless $hook->{config}->{url} eq "http://git.grml.org/github";
31 say "git.grml.org hook already configured";
34 my $rc = $gh->repos->create_hook(
41 'content_type' => 'form',
42 'url' => 'http://git.grml.org/github'
47 if $rc->{config}->{url} eq "http://git.grml.org/github";