forked from lix-project/hydra
Github status API: Pull authorization from github_authorization by default
This commit is contained in:
parent
08708e899a
commit
3d044d2ec2
|
@ -54,10 +54,12 @@ sub common {
|
||||||
next if exists $seen{$input}->{$key};
|
next if exists $seen{$input}->{$key};
|
||||||
$seen{$input}->{$key} = 1;
|
$seen{$input}->{$key} = 1;
|
||||||
$uri =~ m![:/]([^/]+)/([^/]+?)(?:.git)?$!;
|
$uri =~ m![:/]([^/]+)/([^/]+?)(?:.git)?$!;
|
||||||
my $req = HTTP::Request->new('POST', "https://api.github.com/repos/$1/$2/statuses/$rev");
|
my $owner = $1;
|
||||||
|
my $repo = $2;
|
||||||
|
my $req = HTTP::Request->new('POST', "https://api.github.com/repos/$owner/$repo/statuses/$rev");
|
||||||
$req->header('Content-Type' => 'application/json');
|
$req->header('Content-Type' => 'application/json');
|
||||||
$req->header('Accept' => 'application/vnd.github.v3+json');
|
$req->header('Accept' => 'application/vnd.github.v3+json');
|
||||||
$req->header('Authorization' => $conf->{authorization});
|
$req->header('Authorization' => ($self->{config}->{github_authorization}->{$owner} // $conf->{authorization}));
|
||||||
$req->content($body);
|
$req->content($body);
|
||||||
my $res = $ua->request($req);
|
my $res = $ua->request($req);
|
||||||
print STDERR $res->status_line, ": ", $res->decoded_content, "\n" unless $res->is_success;
|
print STDERR $res->status_line, ": ", $res->decoded_content, "\n" unless $res->is_success;
|
||||||
|
|
Loading…
Reference in a new issue