Class GHWorkflowJob

java.lang.Object
org.kohsuke.github.GHObject
org.kohsuke.github.GHWorkflowJob

public class GHWorkflowJob extends GHObject
A workflow run job.
Author:
Guillaume Smet
  • Constructor Details

    • GHWorkflowJob

      public GHWorkflowJob()
      Create default GHWorkflowJob instance
  • Method Details

    • getName

      public String getName()
      The name of the job.
      Returns:
      the name
    • getHeadSha

      public String getHeadSha()
      Gets the HEAD SHA.
      Returns:
      sha for the HEAD commit
    • getStartedAt

      public Date getStartedAt()
      When was this job started?.
      Returns:
      start date
    • getCompletedAt

      public Date getCompletedAt()
      When was this job completed?.
      Returns:
      completion date
    • getStatus

      public GHWorkflowRun.Status getStatus()
      Gets status of the job.

      Can be UNKNOWN if the value returned by GitHub is unknown from the API.

      Returns:
      status of the job
    • getConclusion

      public GHWorkflowRun.Conclusion getConclusion()
      Gets the conclusion of the job.

      Can be UNKNOWN if the value returned by GitHub is unknown from the API.

      Returns:
      conclusion of the job
    • getRunId

      public long getRunId()
      The run id.
      Returns:
      the run id
    • getRunAttempt

      public int getRunAttempt()
      Attempt number of the associated workflow run, 1 for first attempt and higher if the workflow was re-run.
      Returns:
      attempt number
    • getHtmlUrl

      public URL getHtmlUrl()
      Gets the html url.
      Returns:
      the html url
    • getCheckRunUrl

      public URL getCheckRunUrl()
      The check run URL.
      Returns:
      the check run url
    • getSteps

      public List<GHWorkflowJob.Step> getSteps()
      Gets the execution steps of this job.
      Returns:
      the execution steps
    • getLabels

      public List<String> getLabels()
      Gets the labels of the job.
      Returns:
      the labels
    • getRunnerId

      public int getRunnerId()
      the runner id.
      Returns:
      runnerId
    • getRunnerName

      public String getRunnerName()
      the runner name.
      Returns:
      runnerName
    • getRunnerGroupId

      public int getRunnerGroupId()
      the runner group id.
      Returns:
      runnerGroupId
    • getRunnerGroupName

      public String getRunnerGroupName()
      the runner group name.
      Returns:
      runnerGroupName
    • getRepository

      public GHRepository getRepository()
      Repository to which the job belongs.
      Returns:
      the repository
    • downloadLogs

      public <T> T downloadLogs(InputStreamFunction<T> streamFunction) throws IOException
      Downloads the logs.

      The logs are returned as a text file.

      Type Parameters:
      T - the type of result
      Parameters:
      streamFunction - The InputStreamFunction that will process the stream
      Returns:
      the result of reading the stream.
      Throws:
      IOException - The IO exception.