File: merge_branch.pl

package info (click to toggle)
libpithub-perl 0.01043-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,148 kB
  • sloc: perl: 9,098; makefile: 7
file content (18 lines) | stat: -rwxr-xr-x 391 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/env perl

use strict;
use warnings;
use Pithub::Repos ();

my $b = Pithub::Repos->new( token => 'ghp_YoUrTokeN' );

# Merge a branch
my $result = $b->merge_branch(
    user => 'plu', repo => 'Pithub',
    data => { base => 'master', head => 'branch-to-merge' }
);

unless ( $result->success ) {
    printf "something is fishy: %s\n", $result->response->status_line;
    exit 1;
}