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:
  • Constructor Details

    • GHWorkflow

      public GHWorkflow()
  • Method Details

    • 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 class GHObject
      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 the GitHub instance, use a local copy instead of pulling it out of objects.
      Get the root GitHub instance for this object.
      Returns:
      the root GitHub instance