interface GitHubSourceProps
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.CodeBuild.GitHubSourceProps |
Java | software.amazon.awscdk.services.codebuild.GitHubSourceProps |
Python | aws_cdk.aws_codebuild.GitHubSourceProps |
TypeScript (source) | @aws-cdk/aws-codebuild » GitHubSourceProps |
Construction properties for {@link GitHubSource} and {@link GitHubEnterpriseSource}.
Example
const gitHubSource = codebuild.Source.gitHub({
owner: 'awslabs',
repo: 'aws-cdk',
webhook: true, // optional, default: true if `webhookFilters` were provided, false otherwise
webhookTriggersBatchBuild: true, // optional, default is false
webhookFilters: [
codebuild.FilterGroup
.inEventOf(codebuild.EventAction.PUSH)
.andBranchIs('master')
.andCommitMessageIs('the commit message'),
], // optional, by default all pushes and Pull Requests will trigger a build
});
Properties
Name | Type | Description |
---|---|---|
owner | string | The GitHub account/user that owns the repo. |
repo | string | The name of the repo (without the username). |
branch | string | The commit ID, pull request ID, branch name, or tag name that corresponds to the version of the source code you want to build. |
build | string | This parameter is used for the context parameter in the GitHub commit status. |
build | string | The URL that the build will report back to the source provider. |
clone | number | The depth of history to download. |
fetch | boolean | Whether to fetch submodules while cloning git repo. |
identifier? | string | The source identifier. |
report | boolean | Whether to send notifications on your build's start and end. |
webhook? | boolean | Whether to create a webhook that will trigger a build every time an event happens in the repository. |
webhook | Filter [] | A list of webhook filters that can constraint what events in the repository will trigger a build. |
webhook | boolean | Trigger a batch build from a webhook instead of a standard one. |
owner
Type:
string
The GitHub account/user that owns the repo. Example
'awslabs'
repo
Type:
string
The name of the repo (without the username). Example
'aws-cdk'
branchOrRef?
Type:
string
(optional, default: the default branch's HEAD commit ID is used)
The commit ID, pull request ID, branch name, or tag name that corresponds to the version of the source code you want to build. Example
'mybranch'
buildStatusContext?
Type:
string
(optional, default: "AWS CodeBuild $AWS_REGION ($PROJECT_NAME)")
This parameter is used for the context
parameter in the GitHub commit status.
Can use built-in CodeBuild variables, like $AWS_REGION.
See also: https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-env-vars.html Example
"My build #$CODEBUILD_BUILD_NUMBER"
buildStatusUrl?
Type:
string
(optional, default: link to the AWS Console for CodeBuild to a particular build execution)
The URL that the build will report back to the source provider.
Can use built-in CodeBuild variables, like $AWS_REGION.
See also: https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-env-vars.html Example
"$CODEBUILD_PUBLIC_BUILD_URL"
cloneDepth?
Type:
number
(optional)
The depth of history to download.
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?
Type:
boolean
(optional, default: false)
Whether to fetch submodules while cloning git repo.
identifier?
Type:
string
(optional)
The source identifier.
This property is required on secondary sources.
reportBuildStatus?
Type:
boolean
(optional, default: true)
Whether to send notifications on your build's start and end.
webhook?
Type:
boolean
(optional, default: true if any webhookFilters
were provided, false otherwise)
Whether to create a webhook that will trigger a build every time an event happens in the repository.
webhookFilters?
Type:
Filter
[]
(optional, default: every push and every Pull Request (create or update) triggers a build)
A list of webhook filters that can constraint what events in the repository will trigger a build.
A build is triggered if any of the provided filter groups match.
Only valid if webhook
was not provided as false.
webhookTriggersBatchBuild?
Type:
boolean
(optional, default: false)
Trigger a batch build from a webhook instead of a standard one.
Enabling this will enable batch builds on the CodeBuild project.