Skip to content

Commit 7972185

Browse files
Google APIscopybara-github
authored andcommitted
feat: add repositoryevent to buildtrigger
PiperOrigin-RevId: 543799743
1 parent d39c91b commit 7972185

1 file changed

Lines changed: 45 additions & 0 deletions

File tree

google/devtools/cloudbuild/v1/cloudbuild.proto

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ option (google.api.resource_definition) = {
6262
type: "pubsub.googleapis.com/Topic"
6363
pattern: "projects/{project}/topics/{topic}"
6464
};
65+
option (google.api.resource_definition) = {
66+
type: "cloudbuild.googleapis.com/Repository"
67+
pattern: "projects/{project}/locations/{location}/connections/{connection}/repositories/{repository}"
68+
};
6569

6670
// Creates and manages builds on Google Cloud Platform.
6771
//
@@ -1575,6 +1579,47 @@ message BuildTrigger {
15751579
string service_account = 33 [(google.api.resource_reference) = {
15761580
type: "iam.googleapis.com/ServiceAccount"
15771581
}];
1582+
1583+
// The configuration of a trigger that creates a build whenever an event from
1584+
// Repo API is received.
1585+
RepositoryEventConfig repository_event_config = 39;
1586+
}
1587+
1588+
// The configuration of a trigger that creates a build whenever an event from
1589+
// Repo API is received.
1590+
message RepositoryEventConfig {
1591+
// All possible SCM repo types from Repo API.
1592+
enum RepositoryType {
1593+
// If unspecified, RepositoryType defaults to GITHUB.
1594+
REPOSITORY_TYPE_UNSPECIFIED = 0;
1595+
1596+
// The SCM repo is GITHUB.
1597+
GITHUB = 1;
1598+
1599+
// The SCM repo is GITHUB Enterprise.
1600+
GITHUB_ENTERPRISE = 2;
1601+
1602+
// The SCM repo is GITLAB Enterprise.
1603+
GITLAB_ENTERPRISE = 3;
1604+
}
1605+
1606+
// The resource name of the Repo API resource.
1607+
string repository = 1 [(google.api.resource_reference) = {
1608+
type: "cloudbuild.googleapis.com/Repository"
1609+
}];
1610+
1611+
// Output only. The type of the SCM vendor the repository points to.
1612+
RepositoryType repository_type = 2
1613+
[(google.api.field_behavior) = OUTPUT_ONLY];
1614+
1615+
// The types of filter to trigger a build.
1616+
oneof filter {
1617+
// Filter to match changes in pull requests.
1618+
PullRequestFilter pull_request = 3;
1619+
1620+
// Filter to match changes in refs like branches, tags.
1621+
PushFilter push = 4;
1622+
}
15781623
}
15791624

15801625
// GitHubEventsConfig describes the configuration of a trigger that creates a

0 commit comments

Comments
 (0)