Package org.kohsuke.github
Class GHReleaseBuilder
- java.lang.Object
-
- org.kohsuke.github.GHReleaseBuilder
-
public class GHReleaseBuilder extends Object
Builder pattern for creating aGHRelease
.- See Also:
GHRepository#createRelease(String)
-
-
Constructor Summary
Constructors Constructor Description GHReleaseBuilder(GHRepository ghRepository, String tag)
Instantiates a new Gh release builder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GHReleaseBuilder
body(String body)
Body gh release builder.GHReleaseBuilder
categoryName(String categoryName)
Optional.GHReleaseBuilder
commitish(String commitish)
Specifies the commitish value that determines where the Git tag is created from.GHRelease
create()
Create gh release.GHReleaseBuilder
draft(boolean draft)
Optional.GHReleaseBuilder
name(String name)
Name gh release builder.GHReleaseBuilder
prerelease(boolean prerelease)
Optional.
-
-
-
Constructor Detail
-
GHReleaseBuilder
public GHReleaseBuilder(GHRepository ghRepository, String tag)
Instantiates a new Gh release builder.- Parameters:
ghRepository
- the gh repositorytag
- the tag
-
-
Method Detail
-
body
public GHReleaseBuilder body(String body)
Body gh release builder.- Parameters:
body
- The release notes body.- Returns:
- the gh release builder
-
commitish
public GHReleaseBuilder commitish(String commitish)
Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA.- Parameters:
commitish
- Defaults to the repository’s default branch (usually "main"). Unused if the Git tag already exists.- Returns:
- the gh release builder
-
draft
public GHReleaseBuilder draft(boolean draft)
Optional.- Parameters:
draft
-true
to create a draft (unpublished) release,false
to create a published one. Default isfalse
.- Returns:
- the gh release builder
-
name
public GHReleaseBuilder name(String name)
Name gh release builder.- Parameters:
name
- the name of the release- Returns:
- the gh release builder
-
prerelease
public GHReleaseBuilder prerelease(boolean prerelease)
Optional.- Parameters:
prerelease
-true
to identify the release as a prerelease.false
to identify the release as a full release. Default isfalse
.- Returns:
- the gh release builder
-
categoryName
public GHReleaseBuilder categoryName(String categoryName)
Optional.- Parameters:
categoryName
- the category of the discussion to be created for the release. Category should already exist- Returns:
- the gh release builder
-
create
public GHRelease create() throws IOException
Create gh release.- Returns:
- the gh release
- Throws:
IOException
- the io exception
-
-