GitHubSourceOptions Struct
Options for GitHub sources.
Example
ts
pipelines.CodePipelineSource.gitHub('org/repo', 'branch', {
// This is optional
authentication: cdk.SecretValue.secretsManager('my-token'),
});
Properties
actionNameoptionalstringaction_nameoptionalstractionNameoptionalStringActionNameoptionalstringActionNameoptional*string#The action name used for this source in the CodePipeline.
Default: The repository string
authenticationoptionalSecretValueauthenticationoptionalSecretValueauthenticationoptionalSecretValueAuthenticationoptionalSecretValueAuthenticationoptionalSecretValue#A GitHub OAuth token to use for authentication.
Default: SecretValue.secretsManager('github-token')
notes
It is recommended to use a Secrets Manager Secret to obtain the token:
ts
const oauth = cdk.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)
triggeroptionalGitHubTriggertriggeroptionalGitHubTriggertriggeroptionalGitHubTriggerTriggeroptionalGitHubTriggerTriggeroptionalGitHubTrigger= GitHubTrigger.WEBHOOK#How AWS CodePipeline should be triggered.
notes
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).