projects
/
grml-infrastructure.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
86893c7
)
Retidy
master
author
Alexander Wirt
<formorer@debian.org>
Sat, 15 Dec 2012 08:47:14 +0000
(09:47 +0100)
committer
Alexander Wirt
<formorer@debian.org>
Sat, 15 Dec 2012 08:47:14 +0000
(09:47 +0100)
tools/github
patch
|
blob
|
history
diff --git
a/tools/github
b/tools/github
index
0232c9f
..
a486314
100755
(executable)
--- a/
tools/github
+++ b/
tools/github
@@
-7,10
+7,9
@@
use File::Slurp qw ( slurp );
use Data::Dumper;
use Net::GitHub;
use Data::Dumper;
use Net::GitHub;
+my $token = slurp( File::HomeDir->my_home . "/.github-token" );
-my $token = slurp(File::HomeDir->my_home . "/.github-token");
-
-my $gh = Net::GitHub->new( # Net::GitHub::V3
+my $gh = Net::GitHub->new( # Net::GitHub::V3
access_token => $token
);
access_token => $token
);
@@
-18,10
+17,11
@@
my @repos = $gh->repos->list_org('grml');
foreach my $repo (@repos) {
say $repo->{name};
foreach my $repo (@repos) {
say $repo->{name};
- say "-" x length(
$repo->{name}
);
- my @hooks = $gh->repos->hooks(
'grml', $repo->{name}
);
+ say "-" x length(
$repo->{name}
);
+ my @hooks = $gh->repos->hooks(
'grml', $repo->{name}
);
my $found = 0;
foreach my $hook (@hooks) {
my $found = 0;
foreach my $hook (@hooks) {
+
#warn Dumper($hook);
next unless $hook->{name} eq 'web';
next unless $hook->{config}->{url} eq "http://git.grml.org/github";
#warn Dumper($hook);
next unless $hook->{name} eq 'web';
next unless $hook->{config}->{url} eq "http://git.grml.org/github";
@@
-29,16
+29,22
@@
foreach my $repo (@repos) {
}
if ($found) {
say "git.grml.org hook already configured";
}
if ($found) {
say "git.grml.org hook already configured";
- } else {
- my $rc = $gh->repos->create_hook('grml', $repo->{name}, {
- name => 'web',
+ }
+ else {
+ my $rc = $gh->repos->create_hook(
+ 'grml',
+ $repo->{name},
+ {
+ name => 'web',
active => 1,
config => {
'content_type' => 'form',
active => 1,
config => {
'content_type' => 'form',
- 'url' => 'http://git.grml.org/github'
+ 'url'
=> 'http://git.grml.org/github'
}
}
- });
- say "Hook created" if $rc->{config}->{url} eq "http://git.grml.org/github";
+ }
+ );
+ say "Hook created"
+ if $rc->{config}->{url} eq "http://git.grml.org/github";
}
say;
}
}
say;
}