File: rename_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 387 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' );

# Rename branch
my $result = $b->rename_branch(
    user => 'plu', repo => 'Pithub', branch => 'name',
    data => { new_name => 'newname' }
);

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