@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:37.539Z") @Stability(value=Stable) public interface GitHubSourceActionProps extends software.amazon.jsii.JsiiSerializable, CommonActionProps
GitHub source action.
Example:
// Example automatically generated from non-compiling source. May contain errors.
// Read the secret from Secrets Manager
Pipeline pipeline = new Pipeline(this, "MyPipeline");
Artifact sourceOutput = new Artifact();
GitHubSourceAction sourceAction = GitHubSourceAction.Builder.create()
.actionName("GitHub_Source")
.owner("awslabs")
.repo("aws-cdk")
.oauthToken(SecretValue.secretsManager("my-github-token"))
.output(sourceOutput)
.branch("develop")
.build();
pipeline.addStage(StageOptions.builder()
.stageName("Source")
.actions(List.of(sourceAction))
.build());
| Modifier and Type | Interface and Description |
|---|---|
static class |
GitHubSourceActionProps.Builder
A builder for
GitHubSourceActionProps |
static class |
GitHubSourceActionProps.Jsii$Proxy
An implementation for
GitHubSourceActionProps |
| Modifier and Type | Method and Description |
|---|---|
static GitHubSourceActionProps.Builder |
builder() |
default String |
getBranch()
The branch to use.
|
SecretValue |
getOauthToken()
A GitHub OAuth token to use for authentication.
|
Artifact |
getOutput() |
String |
getOwner()
The GitHub account/user that owns the repo.
|
String |
getRepo()
The name of the repo, without the username.
|
default GitHubTrigger |
getTrigger()
How AWS CodePipeline should be triggered.
|
getActionName, getRunOrder, getVariablesNamespace@Stability(value=Stable) @NotNull SecretValue getOauthToken()
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, ... });
If you rotate the value in the Secret, you must also change at least one property of the CodePipeline to force CloudFormation to re-read the secret.
The GitHub Personal Access Token should have these scopes:
@Stability(value=Stable) @NotNull Artifact getOutput()
@Stability(value=Stable) @NotNull String getOwner()
@Stability(value=Stable) @NotNull String getRepo()
@Stability(value=Stable) @Nullable default String getBranch()
Default: "master"
@Stability(value=Stable) @Nullable default GitHubTrigger getTrigger()
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
@Stability(value=Stable) static GitHubSourceActionProps.Builder builder()
builder in interface CommonActionPropsGitHubSourceActionProps.Builder of GitHubSourceActionPropsCopyright © 2022. All rights reserved.