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 void
disable()
Disable the workflow.void
dispatch(String ref)
Create a workflow dispatch event which triggers a manual workflow run.void
dispatch(String ref, Map<String,Object> inputs)
Create a workflow dispatch event which triggers a manual workflow run.void
enable()
Enable the workflow.URL
getBadgeUrl()
The badge URL, like https://github.com/octo-org/octo-repo/workflows/CI/badge.svgURL
getHtmlUrl()
Gets the html url.String
getName()
The name of the workflow.String
getPath()
The path of the workflow e.g.GHRepository
getRepository()
Repository to which the workflow belongs.GitHub
getRoot()
Deprecated.For access to theGitHub
instance, use a local copy instead of pulling it out of objects.String
getState()
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:
getHtmlUrl
in 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 IOException
Disable the workflow.- Throws:
IOException
- the io exception
-
enable
public void enable() throws IOException
Enable 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 theGitHub
instance, use a local copy instead of pulling it out of objects.Get the rootGitHub
instance for this object.- Returns:
- the root
GitHub
instance
-
-