Package org.kohsuke.github
Class GHWorkflow
- java.lang.Object
-
- org.kohsuke.github.GHObject
-
- org.kohsuke.github.GHWorkflow
-
public class GHWorkflow extends GHObject
A workflow.- Author:
- Guillaume Smet
- See Also:
GHRepository.getWorkflow(long)
-
-
Field Summary
-
Fields inherited from class org.kohsuke.github.GHObject
responseHeaderFields
-
-
Constructor Summary
Constructors Constructor Description GHWorkflow()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voiddisable()Disable the workflow.voiddispatch(String ref)Create a workflow dispatch event which triggers a manual workflow run.voiddispatch(String ref, Map<String,Object> inputs)Create a workflow dispatch event which triggers a manual workflow run.voidenable()Enable the workflow.URLgetBadgeUrl()The badge URL, like https://github.com/octo-org/octo-repo/workflows/CI/badge.svgURLgetHtmlUrl()Gets the html url.StringgetName()The name of the workflow.StringgetPath()The path of the workflow e.g.GHRepositorygetRepository()Repository to which the workflow belongs.GitHubgetRoot()Deprecated.For access to theGitHubinstance, use a local copy instead of pulling it out of objects.StringgetState()The state of the workflow.PagedIterable<GHWorkflowRun>listRuns()Lists the workflow runs belong to this workflow.-
Methods inherited from class org.kohsuke.github.GHObject
getCreatedAt, getId, getNodeId, getResponseHeaderFields, getUpdatedAt, getUrl, setResponseHeaderFields, toString
-
-
-
-
Method Detail
-
getName
public String getName()
The name of the workflow.- Returns:
- the name
-
getPath
public String getPath()
The path of the workflow e.g. .github/workflows/blank.yaml- Returns:
- the path
-
getState
public String getState()
The state of the workflow.- Returns:
- the state
-
getHtmlUrl
public URL getHtmlUrl() throws IOException
Gets the html url.- Specified by:
getHtmlUrlin classGHObject- Returns:
- the html url
- Throws:
IOException- Signals that an I/O exception has occurred.
-
getRepository
public GHRepository getRepository()
Repository to which the workflow belongs.- Returns:
- the repository
-
getBadgeUrl
public URL getBadgeUrl()
The badge URL, like https://github.com/octo-org/octo-repo/workflows/CI/badge.svg- Returns:
- the badge url
-
disable
public void disable() throws IOExceptionDisable the workflow.- Throws:
IOException- the io exception
-
enable
public void enable() throws IOExceptionEnable the workflow.- Throws:
IOException- the io exception
-
dispatch
public void dispatch(String ref) throws IOException
Create a workflow dispatch event which triggers a manual workflow run.- Parameters:
ref- the git reference for the workflow. The reference can be a branch or tag name.- Throws:
IOException- the io exception
-
dispatch
public void dispatch(String ref, Map<String,Object> inputs) throws IOException
Create a workflow dispatch event which triggers a manual workflow run.- Parameters:
ref- the git reference for the workflow. The reference can be a branch or tag name.inputs- input keys and values configured in the workflow file. The maximum number of properties is 10. Any default properties configured in the workflow file will be used when inputs are omitted.- Throws:
IOException- the io exception
-
listRuns
public PagedIterable<GHWorkflowRun> listRuns()
Lists the workflow runs belong to this workflow.- Returns:
- the paged iterable
-
getRoot
@Deprecated public GitHub getRoot()
Deprecated.For access to theGitHubinstance, use a local copy instead of pulling it out of objects.Get the rootGitHubinstance for this object.- Returns:
- the root
GitHubinstance
-
-