Class GitHubSourceActionProps.Builder
java.lang.Object
software.amazon.awscdk.services.codepipeline.actions.GitHubSourceActionProps.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<GitHubSourceActionProps>
- Enclosing interface:
- GitHubSourceActionProps
@Stability(Stable)
public static final class GitHubSourceActionProps.Builder
extends Object
implements software.amazon.jsii.Builder<GitHubSourceActionProps>
A builder for
GitHubSourceActionProps
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionactionName
(String actionName) Sets the value ofCommonActionProps.getActionName()
Sets the value ofGitHubSourceActionProps.getBranch()
build()
Builds the configured instance.oauthToken
(SecretValue oauthToken) Sets the value ofGitHubSourceActionProps.getOauthToken()
Sets the value ofGitHubSourceActionProps.getOutput()
Sets the value ofGitHubSourceActionProps.getOwner()
Sets the value ofGitHubSourceActionProps.getRepo()
Sets the value ofCommonActionProps.getRunOrder()
trigger
(GitHubTrigger trigger) Sets the value ofGitHubSourceActionProps.getTrigger()
variablesNamespace
(String variablesNamespace) Sets the value ofCommonActionProps.getVariablesNamespace()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
oauthToken
Sets the value ofGitHubSourceActionProps.getOauthToken()
- Parameters:
oauthToken
- A GitHub OAuth token to use for authentication. This parameter is required. It is recommended to use a Secrets ManagerSecret
to obtain the token:const oauth = cdk.SecretValue.secretsManager('my-github-token'); new GitHubSource(this, 'GitHubAction', { oauthToken: oauth, ... });
The GitHub Personal Access Token should have these scopes:
- repo - to read the repository
- admin:repo_hook - if you plan to use webhooks (true by default)
- Returns:
this
-
output
Sets the value ofGitHubSourceActionProps.getOutput()
- Parameters:
output
- the value to be set. This parameter is required.- Returns:
this
-
owner
Sets the value ofGitHubSourceActionProps.getOwner()
- Parameters:
owner
- The GitHub account/user that owns the repo. This parameter is required.- Returns:
this
-
repo
Sets the value ofGitHubSourceActionProps.getRepo()
- Parameters:
repo
- The name of the repo, without the username. This parameter is required.- Returns:
this
-
branch
Sets the value ofGitHubSourceActionProps.getBranch()
- Parameters:
branch
- The branch to use.- Returns:
this
-
trigger
Sets the value ofGitHubSourceActionProps.getTrigger()
- Parameters:
trigger
- How AWS CodePipeline should be triggered. With the default value "WEBHOOK", a webhook is created in GitHub that triggers the action With "POLL", CodePipeline periodically checks the source for changes With "None", the action is not triggered through changes in the sourceTo use
WEBHOOK
, your GitHub Personal Access Token should have admin:repo_hook scope (in addition to the regular repo scope).- Returns:
this
-
actionName
Sets the value ofCommonActionProps.getActionName()
- Parameters:
actionName
- The physical, human-readable name of the Action. This parameter is required. Note that Action names must be unique within a single Stage.- Returns:
this
-
runOrder
Sets the value ofCommonActionProps.getRunOrder()
- Parameters:
runOrder
- The runOrder property for this Action. RunOrder determines the relative order in which multiple Actions in the same Stage execute.- Returns:
this
-
variablesNamespace
@Stability(Stable) public GitHubSourceActionProps.Builder variablesNamespace(String variablesNamespace) Sets the value ofCommonActionProps.getVariablesNamespace()
- Parameters:
variablesNamespace
- The name of the namespace to use for variables emitted by this action.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<GitHubSourceActionProps>
- Returns:
- a new instance of
GitHubSourceActionProps
- Throws:
NullPointerException
- if any required attribute was not provided
-