Dist-Zilla-Plugin-GitHub-CreateRelease

 view release on metacpan or  search on metacpan

bin/createrelease.pl  view on Meta::CPAN

            target_commitish => $branch,
            name             => $self->get_title(),
            body             => $self->get_notes(),
            draft            => $draft ? JSON::MaybeXS::true : JSON::MaybeXS::false,
            prerelease       => $trial ? JSON::MaybeXS::true : JSON::MaybeXS::false,
            generate_release_notes => $github_notes,
            }
        );

        die "Unable to create release for $identity{login}\\$releases->{repo}" if  ($response->code eq '404');
        #die "Validation failed, or the endpoint has been spammed." if  ($response->code eq '422');
        die "login or token invalid for the specified repository: $identity{login}\\$releases->{repo}\n"
            if  ($response->code eq '403');

        if ($response->code ne '201') {
            my $message = $response->raw_content();
            print "message", $message, "\n";
            $message =~ s/\n/ /gm;
            my $error_message  = decode_json $message;
            for my $error (@{$error_message->{errors}}) {
                print "Field: ", $error->{message}, " - ", $error->{code}, "\n";

lib/Dist/Zilla/Plugin/GitHub/CreateRelease.pm  view on Meta::CPAN

      tag_name         => "$tag",
      target_commitish => $branch,
      name             => $title,
      body             => $notes,
      draft            => $self->{draft} ? JSON::MaybeXS::true : JSON::MaybeXS::false,
      prerelease       => $self->zilla->is_trial ? JSON::MaybeXS::true : JSON::MaybeXS::false,
      generate_release_notes => $self->{github_notes} ? JSON::MaybeXS::true : JSON::MaybeXS::false,
    }
  );
  die "Discussion category name is invalid" if  ($release->response eq '404');
  die "Validation failed, or the endpoint has been spammed." if  ($release->response eq '422');
  die "login ($identity{login}) or token invalid for the specified repository ($releases->{repo})\n"
      if  ($release->code eq '403');

  if (! defined $release->content->{id}) {
    die "Unable to create GitHub release\n";
  }
  $self->log("Release created at $releases->{repo} for $identity{login}");

  my $asset = $releases->assets->create(
    release_id   => $release->content->{id},



( run in 0.310 second using v1.01-cache-2.11-cpan-2b1a40005be )