Package org.kohsuke.github
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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classGHWorkflowJob.StepThe Class Step.
-
Field Summary
-
Fields inherited from class org.kohsuke.github.GHObject
responseHeaderFields
-
-
Constructor Summary
Constructors Constructor Description GHWorkflowJob()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description <T> TdownloadLogs(InputStreamFunction<T> streamFunction)Downloads the logs.URLgetCheckRunUrl()The check run URL.DategetCompletedAt()When was this job completed?.GHWorkflowRun.ConclusiongetConclusion()Gets the conclusion of the job.StringgetHeadSha()Gets the HEAD SHA.URLgetHtmlUrl()Gets the html url.List<String>getLabels()Gets the labels of the job.StringgetName()The name of the job.GHRepositorygetRepository()Repository to which the job belongs.GitHubgetRoot()Deprecated.For access to theGitHubinstance, use a local copy instead of pulling it out of objects.intgetRunAttempt()Attempt number of the associated workflow run, 1 for first attempt and higher if the workflow was re-run.longgetRunId()The run id.intgetRunnerGroupId()the runner group id.StringgetRunnerGroupName()the runner group name.intgetRunnerId()the runner id.StringgetRunnerName()the runner name.DategetStartedAt()When was this job started?.GHWorkflowRun.StatusgetStatus()Gets status of the job.List<GHWorkflowJob.Step>getSteps()Gets the execution steps of this job.-
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 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
UNKNOWNif 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
UNKNOWNif 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.- Specified by:
getHtmlUrlin classGHObject- 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
-
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- TheInputStreamFunctionthat will process the stream- Returns:
- the result of reading the stream.
- Throws:
IOException- The IO exception.
-
getRoot
@Deprecated public GitHub getRoot()
Deprecated.For access to theGitHubinstance, use a local copy instead of pulling it out of objects.Get the rootGitHubinstance for this object.- Returns:
- the root
GitHubinstance
-
-