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 class
GHWorkflowJob.Step
The 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> T
downloadLogs(InputStreamFunction<T> streamFunction)
Downloads the logs.URL
getCheckRunUrl()
The check run URL.Date
getCompletedAt()
When was this job completed?.GHWorkflowRun.Conclusion
getConclusion()
Gets the conclusion of the job.String
getHeadSha()
Gets the HEAD SHA.URL
getHtmlUrl()
Gets the html url.List<String>
getLabels()
Gets the labels of the job.String
getName()
The name of the job.GHRepository
getRepository()
Repository to which the job belongs.GitHub
getRoot()
Deprecated.For access to theGitHub
instance, use a local copy instead of pulling it out of objects.int
getRunAttempt()
Attempt number of the associated workflow run, 1 for first attempt and higher if the workflow was re-run.long
getRunId()
The run id.int
getRunnerGroupId()
the runner group id.String
getRunnerGroupName()
the runner group name.int
getRunnerId()
the runner id.String
getRunnerName()
the runner name.Date
getStartedAt()
When was this job started?.GHWorkflowRun.Status
getStatus()
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
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.- Specified by:
getHtmlUrl
in 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
- TheInputStreamFunction
that 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 theGitHub
instance, use a local copy instead of pulling it out of objects.Get the rootGitHub
instance for this object.- Returns:
- the root
GitHub
instance
-
-