Class GitHubSourceProps
Construction properties for GitHubSource
and GitHubEnterpriseSource
.
Inheritance
Namespace: Amazon.CDK.AWS.CodeBuild
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class GitHubSourceProps : Object, IGitHubSourceProps, ISourceProps
Syntax (vb)
Public Class GitHubSourceProps
Inherits Object
Implements IGitHubSourceProps, ISourceProps
Remarks
ExampleMetadata: infused
Examples
var project = new Project(this, "MyProject", new ProjectProps {
BuildSpec = BuildSpec.FromSourceFilename("my-buildspec.yml"),
Source = Source.GitHub(new GitHubSourceProps {
Owner = "awslabs",
Repo = "aws-cdk"
})
});
Synopsis
Constructors
GitHubSourceProps() |
Properties
BranchOrRef | The commit ID, pull request ID, branch name, or tag name that corresponds to the version of the source code you want to build. |
BuildStatusContext | This parameter is used for the |
BuildStatusUrl | The URL that the build will report back to the source provider. |
CloneDepth | The depth of history to download. |
FetchSubmodules | Whether to fetch submodules while cloning git repo. |
Identifier | The source identifier. |
Owner | The GitHub account/user that owns the repo. |
Repo | The name of the repo (without the username). |
ReportBuildStatus | Whether to send notifications on your build's start and end. |
Webhook | Whether to create a webhook that will trigger a build every time an event happens in the repository. |
WebhookFilters | A list of webhook filters that can constraint what events in the repository will trigger a build. |
WebhookTriggersBatchBuild | Trigger a batch build from a webhook instead of a standard one. |
Constructors
GitHubSourceProps()
public GitHubSourceProps()
Properties
BranchOrRef
The commit ID, pull request ID, branch name, or tag name that corresponds to the version of the source code you want to build.
public string BranchOrRef { get; set; }
Property Value
System.String
Remarks
Default: the default branch's HEAD commit ID is used
Examples
"mybranch";
BuildStatusContext
This parameter is used for the context
parameter in the GitHub commit status.
public string BuildStatusContext { get; set; }
Property Value
System.String
Remarks
Can use built-in CodeBuild variables, like $AWS_REGION.
Default: "AWS CodeBuild $AWS_REGION ($PROJECT_NAME)"
See: https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-env-vars.html
Examples
"My build #$CODEBUILD_BUILD_NUMBER";
BuildStatusUrl
The URL that the build will report back to the source provider.
public string BuildStatusUrl { get; set; }
Property Value
System.String
Remarks
Can use built-in CodeBuild variables, like $AWS_REGION.
Default: - link to the AWS Console for CodeBuild to a particular build execution
See: https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-env-vars.html
Examples
"$CODEBUILD_PUBLIC_BUILD_URL";
CloneDepth
The depth of history to download.
public Nullable<double> CloneDepth { get; set; }
Property Value
System.Nullable<System.Double>
Remarks
Minimum value is 0. If this value is 0, greater than 25, or not provided, then the full history is downloaded with each build of the project.
FetchSubmodules
Whether to fetch submodules while cloning git repo.
public Nullable<bool> FetchSubmodules { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: false
Identifier
The source identifier.
public string Identifier { get; set; }
Property Value
System.String
Remarks
This property is required on secondary sources.
Owner
The GitHub account/user that owns the repo.
public string Owner { get; set; }
Property Value
System.String
Examples
"awslabs";
Repo
The name of the repo (without the username).
public string Repo { get; set; }
Property Value
System.String
Examples
"aws-cdk";
ReportBuildStatus
Whether to send notifications on your build's start and end.
public Nullable<bool> ReportBuildStatus { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: true
Webhook
Whether to create a webhook that will trigger a build every time an event happens in the repository.
public Nullable<bool> Webhook { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: true if any webhookFilters
were provided, false otherwise
WebhookFilters
A list of webhook filters that can constraint what events in the repository will trigger a build.
public FilterGroup[] WebhookFilters { get; set; }
Property Value
Remarks
A build is triggered if any of the provided filter groups match.
Only valid if webhook
was not provided as false.
Default: every push and every Pull Request (create or update) triggers a build
WebhookTriggersBatchBuild
Trigger a batch build from a webhook instead of a standard one.
public Nullable<bool> WebhookTriggersBatchBuild { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
Enabling this will enable batch builds on the CodeBuild project.
Default: false