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 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 html url.StringgetName()The name of the workflow.StringgetPath()The path of the workflow e.g.StringgetState()The state of the 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
Description copied from class:GHObjectGets html url.- Specified by:
getHtmlUrlin classGHObject- Returns:
- URL of this object for humans, which renders some HTML.
- Throws:
IOException- on error
-
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
-
-