- [JSON representation](https://docs.cloud.google.com/build/docs/api/reference/rest/v1/RepoSource#SCHEMA_REPRESENTATION)

Location of the source in a Google Cloud Source Repository.

| JSON representation |
|---|
| ``` { "projectId": string, "repoName": string, "dir": string, "invertRegex": boolean, "substitutions": { string: string, ... }, // The following is a list of mutually exclusive fields. At most one of the // fields will be set in a response: "branchName": string, "tagName": string, "commitSha": string // End of mutually exclusive fields. } ``` |

| Fields ||
|---|---|
| `projectId` | `string` Optional. ID of the project that owns the Cloud Source Repository. If omitted, the project ID requesting the build is assumed. |
| `repoName` | `string` Required. Name of the Cloud Source Repository. |
| `dir` | `string` Optional. Directory, relative to the source root, in which to run the build. This must be a relative path. If a step's `dir` is specified and is an absolute path, this value is ignored for that step's execution. |
| `invertRegex` | `boolean` Optional. Only trigger a build if the revision regex does NOT match the revision regex. |
| `substitutions` | `map (key: string, value: string)` Optional. Substitutions to use in a triggered build. Should only be used with triggers.run An object containing a list of `"key": value` pairs. Example: `{ "name": "wrench", "mass": "1.3kg", "count": "3" }`. |
| A revision within the Cloud Source Repository must be specified in one of these ways. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: ||
| `branchName` | `string` Regex matching branches to build. The syntax of the regular expressions accepted is the syntax accepted by RE2 and described at <https://github.com/google/re2/wiki/Syntax> |
| `tagName` | `string` Regex matching tags to build. The syntax of the regular expressions accepted is the syntax accepted by RE2 and described at <https://github.com/google/re2/wiki/Syntax> |
| `commitSha` | `string` Explicit commit SHA to build. |
| End of mutually exclusive fields. ||