Class GitHubSourceOptions
Options for GitHub sources.
Inheritance
Implements
Namespace: Amazon.CDK.Pipelines
Assembly: Amazon.CDK.Pipelines.dll
Syntax (csharp)
public class GitHubSourceOptions : Object, IGitHubSourceOptions
Syntax (vb)
Public Class GitHubSourceOptions
Inherits Object
Implements IGitHubSourceOptions
Remarks
ExampleMetadata: infused
Examples
CodePipelineSource.GitHub("org/repo", "branch", new GitHubSourceOptions {
// This is optional
Authentication = SecretValue.SecretsManager("my-token")
});
Synopsis
Constructors
GitHubSourceOptions() |
Properties
Authentication | A GitHub OAuth token to use for authentication. |
Trigger | How AWS CodePipeline should be triggered. |
Constructors
GitHubSourceOptions()
public GitHubSourceOptions()
Properties
Authentication
A GitHub OAuth token to use for authentication.
public SecretValue Authentication { get; set; }
Property Value
Remarks
It is recommended to use a Secrets Manager Secret
to obtain the token:
var oauth = SecretValue.SecretsManager("my-github-token");
The GitHub Personal Access Token should have these scopes:
Default: - SecretValue.secretsManager('github-token')
See: https://docs.aws.amazon.com/codepipeline/latest/userguide/GitHub-create-personal-token-CLI.html
Trigger
How AWS CodePipeline should be triggered.
public Nullable<GitHubTrigger> Trigger { get; set; }
Property Value
System.Nullable<GitHubTrigger>
Remarks
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