java.lang.Object
org.kohsuke.github.GHObject
org.kohsuke.github.GHWorkflowRun
A workflow run.
- Author:
- Guillaume Smet
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
The Enum Conclusion.static class
The Class HeadCommit.static enum
The Enum Status. -
Field Summary
Fields inherited from class org.kohsuke.github.GHObject
responseHeaderFields
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
approve()
Approve the workflow run.void
cancel()
Cancel the workflow run.void
delete()
Delete the workflow run.void
Delete the logs.<T> T
downloadLogs
(InputStreamFunction<T> streamFunction) Downloads the logs.The artifacts URL, like https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/artifactsThe cancel URL, like https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/cancelThe check suite URL, like https://api.github.com/repos/octo-org/octo-repo/check-suites/414944374Gets the conclusion of the workflow run.The display title of the workflow run.getEvent()
The type of event that triggered the build.The head branch name the changes are on.The commit of current head.The repository of current head.Gets the HEAD SHA.Gets the html url.The jobs URL, like https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/jobsThe logs URL, like https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/logsgetName()
The name of the workflow run.Gets the pull requests participated in this workflow run.Repository to which the workflow run belongs.The rerun URL, like https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/rerunlong
The run attempt.long
The run number.When was this run triggered?.Gets status of the workflow run.long
The workflow id.The workflow URL, like https://api.github.com/repos/octo-org/octo-repo/actions/workflows/159038Returns the list of jobs from all the executions of this workflow run.Lists the artifacts attached to this workflow run.listJobs()
Returns the list of jobs of this workflow run for the last execution.void
rerun()
Rerun the workflow run.Methods inherited from class org.kohsuke.github.GHObject
getCreatedAt, getId, getNodeId, getResponseHeaderFields, getUpdatedAt, getUrl, setResponseHeaderFields, toString
-
Constructor Details
-
GHWorkflowRun
public GHWorkflowRun()Create default GHWorkflowRun instance
-
-
Method Details
-
getName
The name of the workflow run.- Returns:
- the name
-
getDisplayTitle
The display title of the workflow run.- Returns:
- the displayTitle
-
getRunNumber
public long getRunNumber()The run number.- Returns:
- the run number
-
getWorkflowId
public long getWorkflowId()The workflow id.- Returns:
- the workflow id
-
getRunAttempt
public long getRunAttempt()The run attempt.- Returns:
- the run attempt
-
getRunStartedAt
When was this run triggered?.- Returns:
- run triggered
- Throws:
IOException
- on error
-
getHtmlUrl
Gets the html url.- Returns:
- the html url
- Throws:
IOException
- Signals that an I/O exception has occurred.
-
getJobsUrl
The jobs URL, like https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/jobs- Returns:
- the jobs url
-
getLogsUrl
The logs URL, like https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/logs- Returns:
- the logs url
-
getCheckSuiteUrl
The check suite URL, like https://api.github.com/repos/octo-org/octo-repo/check-suites/414944374- Returns:
- the check suite url
-
getArtifactsUrl
The artifacts URL, like https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/artifacts- Returns:
- the artifacts url
-
getCancelUrl
The cancel URL, like https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/cancel- Returns:
- the cancel url
-
getRerunUrl
The rerun URL, like https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/rerun- Returns:
- the rerun url
-
getWorkflowUrl
The workflow URL, like https://api.github.com/repos/octo-org/octo-repo/actions/workflows/159038- Returns:
- the workflow url
-
getHeadBranch
The head branch name the changes are on.- Returns:
- head branch name
-
getHeadSha
Gets the HEAD SHA.- Returns:
- sha for the HEAD commit
-
getHeadCommit
The commit of current head.- Returns:
- head commit
-
getHeadRepository
The repository of current head.- Returns:
- head repository
-
getEvent
The type of event that triggered the build.- Returns:
- type of event
-
getStatus
Gets status of the workflow run.Can be
UNKNOWN
if the value returned by GitHub is unknown from the API.- Returns:
- status of the workflow run
-
getConclusion
Gets the conclusion of the workflow run.Can be
UNKNOWN
if the value returned by GitHub is unknown from the API.- Returns:
- conclusion of the workflow run
-
getRepository
Repository to which the workflow run belongs.- Returns:
- the repository
-
getPullRequests
Gets the pull requests participated in this workflow run. Note this field is only populated for events. When getting aGHWorkflowRun
outside of an event, this is always empty.- Returns:
- the list of
GHPullRequest
s for this workflow run. Only populated for events. - Throws:
IOException
- the io exception
-
cancel
Cancel the workflow run.- Throws:
IOException
- the io exception
-
delete
Delete the workflow run.- Throws:
IOException
- the io exception
-
rerun
Rerun the workflow run.- Throws:
IOException
- the io exception
-
approve
Approve the workflow run.- Throws:
IOException
- the io exception
-
listArtifacts
Lists the artifacts attached to this workflow run.- Returns:
- the paged iterable
-
downloadLogs
Downloads the logs.The logs are in the form of a zip archive.
Note that the archive is the same as the one downloaded from a workflow run so it contains the logs for all jobs.
- 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.
-
deleteLogs
Delete the logs.- Throws:
IOException
- the io exception
-
listJobs
Returns the list of jobs of this workflow run for the last execution.- Returns:
- list of jobs from the last execution
-
listAllJobs
Returns the list of jobs from all the executions of this workflow run.- Returns:
- list of jobs from all the executions
-