Class GitHubSourceAction.Builder

java.lang.Object
software.amazon.awscdk.services.codepipeline.actions.GitHubSourceAction.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<GitHubSourceAction>
Enclosing class:
GitHubSourceAction

@Stability(Stable) public static final class GitHubSourceAction.Builder extends Object implements software.amazon.jsii.Builder<GitHubSourceAction>
A fluent builder for GitHubSourceAction.
  • Method Details

    • create

      @Stability(Stable) public static GitHubSourceAction.Builder create()
      Returns:
      a new instance of GitHubSourceAction.Builder.
    • actionName

      @Stability(Stable) public GitHubSourceAction.Builder actionName(String actionName)
      The physical, human-readable name of the Action.

      Note that Action names must be unique within a single Stage.

      Parameters:
      actionName - The physical, human-readable name of the Action. This parameter is required.
      Returns:
      this
    • runOrder

      @Stability(Stable) public GitHubSourceAction.Builder runOrder(Number runOrder)
      The runOrder property for this Action.

      RunOrder determines the relative order in which multiple Actions in the same Stage execute.

      Default: 1

      Parameters:
      runOrder - The runOrder property for this Action. This parameter is required.
      Returns:
      this
      See Also:
    • variablesNamespace

      @Stability(Stable) public GitHubSourceAction.Builder variablesNamespace(String variablesNamespace)
      The name of the namespace to use for variables emitted by this action.

      Default: - a name will be generated, based on the stage and action names, if any of the action's variables were referenced - otherwise, no namespace will be set

      Parameters:
      variablesNamespace - The name of the namespace to use for variables emitted by this action. This parameter is required.
      Returns:
      this
    • oauthToken

      @Stability(Stable) public GitHubSourceAction.Builder oauthToken(SecretValue oauthToken)
      A GitHub OAuth token to use for authentication.

      It is recommended to use a Secrets Manager Secret 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)

      Parameters:
      oauthToken - A GitHub OAuth token to use for authentication. This parameter is required.
      Returns:
      this
      See Also:
    • output

      @Stability(Stable) public GitHubSourceAction.Builder output(Artifact output)
      Parameters:
      output - This parameter is required.
      Returns:
      this
    • owner

      @Stability(Stable) public GitHubSourceAction.Builder owner(String owner)
      The GitHub account/user that owns the repo.

      Parameters:
      owner - The GitHub account/user that owns the repo. This parameter is required.
      Returns:
      this
    • repo

      @Stability(Stable) public GitHubSourceAction.Builder repo(String repo)
      The name of the repo, without the username.

      Parameters:
      repo - The name of the repo, without the username. This parameter is required.
      Returns:
      this
    • branch

      @Stability(Stable) public GitHubSourceAction.Builder branch(String branch)
      The branch to use.

      Default: "master"

      Parameters:
      branch - The branch to use. This parameter is required.
      Returns:
      this
    • trigger

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

      Default: GitHubTrigger.WEBHOOK

      Parameters:
      trigger - How AWS CodePipeline should be triggered. This parameter is required.
      Returns:
      this
    • build

      @Stability(Stable) public GitHubSourceAction build()
      Specified by:
      build in interface software.amazon.jsii.Builder<GitHubSourceAction>
      Returns:
      a newly built instance of GitHubSourceAction.