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 Details

    • Builder

      public Builder()
  • Method Details

    • actionName

      @Stability(Stable) public GitHubSourceOptions.Builder actionName(String actionName)
      Parameters:
      actionName - The action name used for this source in the CodePipeline.
      Returns:
      this
    • authentication

      @Stability(Stable) public GitHubSourceOptions.Builder authentication(SecretValue authentication)
      Parameters:
      authentication - A GitHub OAuth token to use for authentication. It is recommended to use a Secrets Manager Secret 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

      @Stability(Stable) public GitHubSourceOptions.Builder trigger(GitHubTrigger trigger)
      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

      @Stability(Stable) public GitHubSourceOptions build()
      Builds the configured instance.
      Specified by:
      build in interface software.amazon.jsii.Builder<GitHubSourceOptions>
      Returns:
      a new instance of GitHubSourceOptions
      Throws:
      NullPointerException - if any required attribute was not provided