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 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 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.String
getState()
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:GHObject
Gets html url.- Specified by:
getHtmlUrl
in classGHObject
- Returns:
- URL of this object for humans, which renders some HTML.
- Throws:
IOException
- on error
-
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
-
-