Class GitHubRepository
-
Field Summary
Fields inherited from class com.atlassian.bamboo.specs.api.builders.repository.VcsRepository
description, name, oid, parent, project, repositoryViewer, TYPE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionappAuthentication
(@NotNull SharedCredentialsIdentifier sharedCredentialsIdentifier) Configures authentication using shared credentials for a GitHub App private key.appAuthentication
(@NotNull SshPrivateKeyAuthentication sshPrivateKeyAuthentication) Configures authentication using a GitHub App private key.Sets the GitHub App ID.authentication
(@NotNull SharedCredentialsIdentifier sharedCredentialsIdentifier) Deprecated.authentication
(@NotNull UserPasswordAuthentication userPasswordAuthentication) Deprecated.since 12.0, usepatAuthentication(UserPasswordAuthentication)
.Checks base Url.Sets branch to check out.protected GitHubRepositoryProperties
build()
changeDetection
(@NotNull VcsChangeDetection vcsChangeDetection) Sets change detection options for this repository.commandTimeout
(Duration commandTimeout) Specifies how much time is given for git commands to finish.commandTimeoutInMinutes
(int commandTimeoutMinutes) Specifies how much time in minutes is given for git commands to finish.Resets all change detection options to defaults.fetchWholeRepository
(boolean fetchWholeRepository) Enforces (or not) fetching all remote refs from the repository rather than single branch.lfsEnabled
(boolean useLfs) Enables/disables git lfs support.patAuthentication
(@NotNull SharedCredentialsIdentifier sharedCredentialsIdentifier) Configures authentication using username/access token shared credentials.patAuthentication
(@NotNull UserPasswordAuthentication userPasswordAuthentication) Configures authentication using a username and access token.remoteAgentCacheEnabled
(boolean useRemoteAgentCache) Enables/disables caching repository content on the remote and elastic agents.repository
(@NotNull String repository) Sets gitHub repository name.shallowClonesEnabled
(boolean useShallowClones) Enables/disables shallow clones when checking out from the repository.sshKeyAppliesToSubmodules
(boolean sshKeyAppliesToSubmodules) Enables/disabled authenticating to submodules with SSH key configured for this repository.submodulesEnabled
(boolean useSubmodules) Enables/disables submodule support.submodulesUseShallowClonesEnabled
(boolean useSubmodulesWithShallowClones) Enables/disables shallow clone support for submodules.verboseLogs
(boolean verboseLogs) Enables/disables verbose logs from git commands.webhookEnabled
(boolean webhookEnabled) Enables webhooks support for the repository.Methods inherited from class com.atlassian.bamboo.specs.api.builders.repository.VcsRepository
description, getIdentifier, getName, getOid, humanReadableId, humanReadableType, name, oid, oid, parent, project, repositoryViewer
-
Constructor Details
-
GitHubRepository
public GitHubRepository()
-
-
Method Details
-
repository
Sets gitHub repository name.- Parameters:
repository
- repository name.
-
branch
Sets branch to check out. -
authentication
@Deprecated public GitHubRepository authentication(@NotNull @NotNull UserPasswordAuthentication userPasswordAuthentication) Deprecated.since 12.0, usepatAuthentication(UserPasswordAuthentication)
.Configures authentication using a username and access token.This method sets up authentication for the GitHub repository by providing a
UserPasswordAuthentication
object. The object must contain valid credentials (username and access token) to access the repository.- Parameters:
userPasswordAuthentication
- the authentication object containing the username and access token.- Returns:
- the current instance of
GitHubRepository
for method chaining. - Throws:
PropertiesValidationException
- ifuserPasswordAuthentication
is null.
-
patAuthentication
public GitHubRepository patAuthentication(@NotNull @NotNull UserPasswordAuthentication userPasswordAuthentication) Configures authentication using a username and access token.This method sets up authentication for the GitHub repository by providing a
UserPasswordAuthentication
object. The object must contain valid credentials (username and access token) to access the repository.Note: Use either Personal Access Token (PAT) authentication via this method or
patAuthentication(UserPasswordAuthentication)
, or GitHub App authentication (App ID + App Authentication) viaappId(String)
andappAuthentication(SshPrivateKeyAuthentication)
orappAuthentication(SharedCredentialsIdentifier)
.- Parameters:
userPasswordAuthentication
- the authentication object containing the username and access token.- Returns:
- the current instance of
GitHubRepository
for method chaining. - Throws:
PropertiesValidationException
- ifuserPasswordAuthentication
is null.
-
appId
Sets the GitHub App ID.This method specifies the App ID required for GitHub App authentication. To enable GitHub App authentication, this method must be used in combination with
appAuthentication(SshPrivateKeyAuthentication)
orappAuthentication(SharedCredentialsIdentifier)
.Note: Use either GitHub App authentication (App ID + App Authentication) or Personal Access Token (PAT) authentication via
patAuthentication(UserPasswordAuthentication)
orpatAuthentication(SharedCredentialsIdentifier)
.- Parameters:
appId
- the GitHub App ID.- Returns:
- the current instance of
GitHubRepository
for method chaining. - Throws:
PropertiesValidationException
- ifappId
is null.- Since:
- 12.0
-
appAuthentication
public GitHubRepository appAuthentication(@NotNull @NotNull SshPrivateKeyAuthentication sshPrivateKeyAuthentication) Configures authentication using a GitHub App private key.This method sets up authentication for the GitHub repository by providing an
SshPrivateKeyAuthentication
object. To enable GitHub App authentication, this method must be used in combination withappId(String)
.Note: Use either GitHub App authentication (App ID + App Authentication) or Personal Access Token (PAT) authentication via
patAuthentication(UserPasswordAuthentication)
orpatAuthentication(SharedCredentialsIdentifier)
.- Parameters:
sshPrivateKeyAuthentication
- the authentication object containing the private key.- Returns:
- the current instance of
GitHubRepository
for method chaining. - Throws:
PropertiesValidationException
- ifsshPrivateKeyAuthentication
is null.- Since:
- 12.0
-
shallowClonesEnabled
Enables/disables shallow clones when checking out from the repository. Fetches the shallowest commit history possible. Do not use if your build depends on full repository history. Shallow clones are switched off by default. -
submodulesEnabled
Enables/disables submodule support. Turned off by default. -
submodulesUseShallowClonesEnabled
Enables/disables shallow clone support for submodules. Turned off by default. -
sshKeyAppliesToSubmodules
Enables/disabled authenticating to submodules with SSH key configured for this repository. -
remoteAgentCacheEnabled
Enables/disables caching repository content on the remote and elastic agents. Bamboo uses caching to reduce bandwidth needed when retrieving source code from the repository. The feature is turned on by default. -
commandTimeout
Specifies how much time is given for git commands to finish. Default is 180 minutes. -
commandTimeoutInMinutes
Specifies how much time in minutes is given for git commands to finish. Default is 180 minutes. -
verboseLogs
Enables/disables verbose logs from git commands. Off by default. -
fetchWholeRepository
Enforces (or not) fetching all remote refs from the repository rather than single branch. Off by default. -
lfsEnabled
Enables/disables git lfs support. Off by default. -
defaultChangeDetection
Resets all change detection options to defaults. -
baseUrl
Checks base Url. Default is "https://github.com" -
changeDetection
Sets change detection options for this repository.- See Also:
-
webhookEnabled
Enables webhooks support for the repository. Off by default.- Since:
- 10.1
-
build
- Specified by:
build
in classVcsRepository<GitHubRepository,
GitHubRepositoryProperties> - Throws:
PropertiesValidationException
-
patAuthentication(SharedCredentialsIdentifier)
.