Package software.amazon.awscdk.pipelines
Class GitHubSourceOptions.Builder
java.lang.Object
software.amazon.awscdk.pipelines.GitHubSourceOptions.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<GitHubSourceOptions>
- Enclosing interface:
GitHubSourceOptions
@Stability(Stable)
public static final class GitHubSourceOptions.Builder
extends Object
implements software.amazon.jsii.Builder<GitHubSourceOptions>
A builder for
GitHubSourceOptions
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionactionName
(String actionName) Sets the value ofGitHubSourceOptions.getActionName()
authentication
(SecretValue authentication) Sets the value ofGitHubSourceOptions.getAuthentication()
build()
Builds the configured instance.trigger
(GitHubTrigger trigger) Sets the value ofGitHubSourceOptions.getTrigger()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
actionName
Sets the value ofGitHubSourceOptions.getActionName()
- Parameters:
actionName
- The action name used for this source in the CodePipeline.- Returns:
this
-
authentication
Sets the value ofGitHubSourceOptions.getAuthentication()
- Parameters:
authentication
- A GitHub OAuth token to use for authentication. It is recommended to use a Secrets ManagerSecret
to obtain the token:SecretValue oauth = SecretValue.secretsManager("my-github-token");
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
-
trigger
Sets the value ofGitHubSourceOptions.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 source.To use
WEBHOOK
, your GitHub Personal Access Token should have admin:repo_hook scope (in addition to the regular repo scope).- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<GitHubSourceOptions>
- Returns:
- a new instance of
GitHubSourceOptions
- Throws:
NullPointerException
- if any required attribute was not provided
-