UpdateWebhook
Updates the webhook associated with an AWS CodeBuild build project.
Note
If you use Bitbucket for your repository, rotateSecret is ignored.
Request Syntax
{
"branchFilter": "string",
"buildType": "string",
"filterGroups": [
[
{
"excludeMatchedPattern": boolean,
"pattern": "string",
"type": "string"
}
]
],
"projectName": "string",
"pullRequestBuildPolicy": {
"approverRoles": [ "string" ],
"requiresCommentApproval": "string"
},
"rotateSecret": boolean
}
Request Parameters
For information about the parameters that are common to all actions, see Common Parameters.
The request accepts the following data in JSON format.
Note
In the following list, the required parameters are described first.
- projectName
-
The name of the AWS CodeBuild project.
Type: String
Length Constraints: Minimum length of 2. Maximum length of 150.
Pattern:
[A-Za-z0-9][A-Za-z0-9\-_]{1,149}Required: Yes
- branchFilter
-
A regular expression used to determine which repository branches are built when a webhook is triggered. If the name of a branch matches the regular expression, then it is built. If
branchFilteris empty, then all branches are built.Note
It is recommended that you use
filterGroupsinstead ofbranchFilter.Type: String
Required: No
- buildType
-
Specifies the type of build this webhook will trigger.
Note
RUNNER_BUILDKITE_BUILDis only available forNO_SOURCEsource type projects configured for Buildkite runner builds. For more information about CodeBuild-hosted Buildkite runner builds, see Tutorial: Configure a CodeBuild-hosted Buildkite runner in the AWS CodeBuild user guide.Type: String
Valid Values:
BUILD | BUILD_BATCH | RUNNER_BUILDKITE_BUILDRequired: No
- filterGroups
-
An array of arrays of
WebhookFilterobjects used to determine if a webhook event can trigger a build. A filter group must contain at least oneEVENTWebhookFilter.Type: Array of arrays of WebhookFilter objects
Required: No
- pullRequestBuildPolicy
-
A PullRequestBuildPolicy object that defines comment-based approval requirements for triggering builds on pull requests. This policy helps control when automated builds are executed based on contributor permissions and approval workflows.
Type: PullRequestBuildPolicy object
Required: No
- rotateSecret
-
A boolean value that specifies whether the associated GitHub repository's secret token should be updated. If you use Bitbucket for your repository,
rotateSecretis ignored.Type: Boolean
Required: No
Response Syntax
{
"webhook": {
"branchFilter": "string",
"buildType": "string",
"filterGroups": [
[
{
"excludeMatchedPattern": boolean,
"pattern": "string",
"type": "string"
}
]
],
"lastModifiedSecret": number,
"manualCreation": boolean,
"payloadUrl": "string",
"pullRequestBuildPolicy": {
"approverRoles": [ "string" ],
"requiresCommentApproval": "string"
},
"scopeConfiguration": {
"domain": "string",
"name": "string",
"scope": "string"
},
"secret": "string",
"status": "string",
"statusMessage": "string",
"url": "string"
}
}
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
The following data is returned in JSON format by the service.
Errors
For information about the errors that are common to all actions, see Common Errors.
- InvalidInputException
-
The input value that was provided is not valid.
HTTP Status Code: 400
- OAuthProviderException
-
There was a problem with the underlying OAuth provider.
HTTP Status Code: 400
- ResourceNotFoundException
-
The specified AWS resource cannot be found.
HTTP Status Code: 400
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: