Package io.jenkins.plugins.checks.github
Class GitHubChecksContext
java.lang.Object
io.jenkins.plugins.checks.github.GitHubChecksContext
Base class for a context that publishes GitHub checks.
-
Constructor Summary
ModifierConstructorDescriptionprotected
GitHubChecksContext
(Job<?, ?> job, String url, SCMFacade scmFacade) -
Method Summary
Modifier and TypeMethodDescriptioncom.cloudbees.plugins.credentials.common.StandardUsernameCredentials
Returns the credentials to access the remote GitHub repository.protected abstract String
protected com.cloudbees.plugins.credentials.common.StandardUsernameCredentials
getGitHubAppCredentials
(String credentialsId) abstract String
Returns the commit sha of the run.Returns the id of aGitHubChecksAction
for this run, if any.protected Job<?,
?> getJob()
abstract String
Returns the source repository's full name of the run.getRun()
protected final SCMFacade
getURL()
Returns the URL of the run's summary page, e.g.protected boolean
protected boolean
protected boolean
hasValidCredentials
(edu.hm.hafner.util.FilteredLog logger) abstract boolean
isValid
(edu.hm.hafner.util.FilteredLog logger) Returns whether the context is valid (with all properties functional) to use.
-
Constructor Details
-
GitHubChecksContext
-
-
Method Details
-
getHeadSha
Returns the commit sha of the run.- Returns:
- the commit sha of the run
-
getRepository
Returns the source repository's full name of the run. The full name consists of the owner's name and the repository's name, e.g. jenkins-ci/jenkins- Returns:
- the source repository's full name
-
isValid
public abstract boolean isValid(edu.hm.hafner.util.FilteredLog logger) Returns whether the context is valid (with all properties functional) to use.- Parameters:
logger
- the filtered logger- Returns:
- whether the context is valid to use
-
getCredentialsId
-
getCredentials
public com.cloudbees.plugins.credentials.common.StandardUsernameCredentials getCredentials()Returns the credentials to access the remote GitHub repository.- Returns:
- the credentials
-
getURL
Returns the URL of the run's summary page, e.g. https://ci.jenkins.io/job/Core/job/jenkins/job/master/2000/.- Returns:
- the URL of the summary page
-
getJob
-
getScmFacade
-
getGitHubAppCredentials
protected com.cloudbees.plugins.credentials.common.StandardUsernameCredentials getGitHubAppCredentials(String credentialsId) -
hasGitHubAppCredentials
protected boolean hasGitHubAppCredentials() -
hasCredentialsId
protected boolean hasCredentialsId() -
hasValidCredentials
protected boolean hasValidCredentials(edu.hm.hafner.util.FilteredLog logger) -
getId
Returns the id of aGitHubChecksAction
for this run, if any.- Parameters:
name
- the name of the check- Returns:
- the id of the check run
-
getRun
-