File: rename_branch.pl

package info (click to toggle)
libpithub-perl 0.01040-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,128 kB
  • sloc: perl: 7,005; makefile: 7
file content (17 lines) | stat: -rwxr-xr-x 393 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/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;
}