Allow this build step to fail without failing the entire build if and
only if the exit code is one of the specified codes. If allow_failure
is also specified, this field will take precedence.
Allow this build step to fail without failing the entire build.
If false, the entire build will fail if this step fails. Otherwise, the
build will succeed, but this step will still have a failure status.
Error information will be reported in the failure_detail field.
A list of arguments that will be presented to the step when it is started.
If the image used to run the step's container has an entrypoint, the args
are used as arguments to that entrypoint. If the image does not define
an entrypoint, the first element in args is used as the entrypoint,
and the remainder will be used as arguments.
Working directory to use when running this step's container.
If this value is a relative path, it is relative to the build's working
directory. If this value is absolute, it may be outside the build's working
directory, in which case the contents of the path may not be persisted
across build step executions, unless a volume for that path is specified.
If the build specifies a RepoSource with dir and a step with a dir,
which specifies an absolute path, the RepoSourcedir is ignored for
the step's execution.
Required. The name of the container image that will run this particular
build step.
If the image is available in the host's Docker daemon's cache, it
will be run directly. If not, the host will attempt to pull the image
first, using the builder service account's credentials if necessary.
The Docker daemon's cache will already have the latest versions of all of
the officially supported build steps
(https://github.com/GoogleCloudPlatform/cloud-builders).
The Docker daemon will also have cached many of the layers for some popular
images, like "ubuntu", "debian", but they will be refreshed at the time you
attempt to use them.
If you built an image in a previous build step, it will be stored in the
host's Docker daemon's cache and is available to use as the name for a
later build step.
A list of environment variables which are encrypted using a Cloud Key
Management Service crypto key. These values must be specified in the
build's Secret.
Output only. Status of the build step. At this time, build step status is
only updated on build completion; step status is not updated in real-time
as the build progresses.
Time limit for executing this build step. If not defined, the step has no
time limit and will be allowed to continue to run until either it completes
or the build itself times out.
Each volume is created as an empty volume prior to execution of the
build step. Upon completion of the build, volumes and their contents are
discarded.
Using a named volume in only one step is not valid as it is indicative
of a build request with an incorrect configuration.
The ID(s) of the step(s) that this build step depends on.
This build step will not start until all the build steps in wait_for
have completed successfully. If wait_for is empty, this build step will
start when all previous build steps in the Build.Steps list have
completed successfully.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-19 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eBuildStep\u003c/code\u003e class in the Google Cloud Build v1 API represents a single step within a build pipeline, defining the actions to be executed.\u003c/p\u003e\n"],["\u003cp\u003eThis page provides documentation for the \u003ccode\u003eBuildStep\u003c/code\u003e class, which includes details on its constructors, properties, inherited members, and implements interfaces such as \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, \u003ccode\u003eIDeepCloneable\u003c/code\u003e, and \u003ccode\u003eIBufferMessage\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe documentation supports multiple versions of the Google.Cloud.CloudBuild.V1 API, with version 2.15.0 being the latest and other versions available spanning from 1.0.0 to 2.14.0.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eBuildStep\u003c/code\u003e properties include configurations like \u003ccode\u003eName\u003c/code\u003e, \u003ccode\u003eArgs\u003c/code\u003e, \u003ccode\u003eEnv\u003c/code\u003e, \u003ccode\u003eDir\u003c/code\u003e, and \u003ccode\u003eScript\u003c/code\u003e, allowing customization of how a build step is executed, and also includes output data such as \u003ccode\u003eExitCode\u003c/code\u003e, \u003ccode\u003eStatus\u003c/code\u003e, \u003ccode\u003eTiming\u003c/code\u003e, and \u003ccode\u003ePullTiming\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eBuild steps can have dependencies specified via the \u003ccode\u003eWaitFor\u003c/code\u003e property, error handling via \u003ccode\u003eAllowFailure\u003c/code\u003e and \u003ccode\u003eAllowExitCodes\u003c/code\u003e, and environment variables, including encrypted ones using \u003ccode\u003eSecretEnv\u003c/code\u003e, and can also have volumes mounted via \u003ccode\u003eVolumes\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Cloud Build v1 API - Class BuildStep (2.16.0)\n\nVersion latestkeyboard_arrow_down\n\n- [2.16.0 (latest)](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/latest/Google.Cloud.CloudBuild.V1.BuildStep)\n- [2.15.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/2.15.0/Google.Cloud.CloudBuild.V1.BuildStep)\n- [2.14.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/2.14.0/Google.Cloud.CloudBuild.V1.BuildStep)\n- [2.13.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/2.13.0/Google.Cloud.CloudBuild.V1.BuildStep)\n- [2.12.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/2.12.0/Google.Cloud.CloudBuild.V1.BuildStep)\n- [2.11.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/2.11.0/Google.Cloud.CloudBuild.V1.BuildStep)\n- [2.10.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/2.10.0/Google.Cloud.CloudBuild.V1.BuildStep)\n- [2.9.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/2.9.0/Google.Cloud.CloudBuild.V1.BuildStep)\n- [2.8.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/2.8.0/Google.Cloud.CloudBuild.V1.BuildStep)\n- [2.7.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/2.7.0/Google.Cloud.CloudBuild.V1.BuildStep)\n- [2.6.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/2.6.0/Google.Cloud.CloudBuild.V1.BuildStep)\n- [2.5.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/2.5.0/Google.Cloud.CloudBuild.V1.BuildStep)\n- [2.4.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/2.4.0/Google.Cloud.CloudBuild.V1.BuildStep)\n- [2.3.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/2.3.0/Google.Cloud.CloudBuild.V1.BuildStep)\n- [2.2.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/2.2.0/Google.Cloud.CloudBuild.V1.BuildStep)\n- [2.1.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/2.1.0/Google.Cloud.CloudBuild.V1.BuildStep)\n- [2.0.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/2.0.0/Google.Cloud.CloudBuild.V1.BuildStep)\n- [1.4.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/1.4.0/Google.Cloud.CloudBuild.V1.BuildStep)\n- [1.3.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/1.3.0/Google.Cloud.CloudBuild.V1.BuildStep)\n- [1.2.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/1.2.0/Google.Cloud.CloudBuild.V1.BuildStep)\n- [1.1.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/1.1.0/Google.Cloud.CloudBuild.V1.BuildStep)\n- [1.0.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/1.0.0/Google.Cloud.CloudBuild.V1.BuildStep) \n\n public sealed class BuildStep : IMessage\u003cBuildStep\u003e, IEquatable\u003cBuildStep\u003e, IDeepCloneable\u003cBuildStep\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Cloud Build v1 API class BuildStep.\n\nA step in the build pipeline. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e BuildStep \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[BuildStep](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/latest/Google.Cloud.CloudBuild.V1.BuildStep), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[BuildStep](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/latest/Google.Cloud.CloudBuild.V1.BuildStep), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[BuildStep](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/latest/Google.Cloud.CloudBuild.V1.BuildStep), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Cloud.CloudBuild.V1](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/latest/Google.Cloud.CloudBuild.V1)\n\nAssembly\n--------\n\nGoogle.Cloud.CloudBuild.V1.dll\n\nConstructors\n------------\n\n### BuildStep()\n\n public BuildStep()\n\n### BuildStep(BuildStep)\n\n public BuildStep(BuildStep other)\n\nProperties\n----------\n\n### AllowExitCodes\n\n public RepeatedField\u003cint\u003e AllowExitCodes { get; }\n\nAllow this build step to fail without failing the entire build if and\nonly if the exit code is one of the specified codes. If allow_failure\nis also specified, this field will take precedence.\n\n### AllowFailure\n\n public bool AllowFailure { get; set; }\n\nAllow this build step to fail without failing the entire build.\n\nIf false, the entire build will fail if this step fails. Otherwise, the\nbuild will succeed, but this step will still have a failure status.\nError information will be reported in the failure_detail field.\n\n### Args\n\n public RepeatedField\u003cstring\u003e Args { get; }\n\nA list of arguments that will be presented to the step when it is started.\n\nIf the image used to run the step's container has an entrypoint, the `args`\nare used as arguments to that entrypoint. If the image does not define\nan entrypoint, the first element in args is used as the entrypoint,\nand the remainder will be used as arguments.\n\n### AutomapSubstitutions\n\n public bool AutomapSubstitutions { get; set; }\n\nOption to include built-in and custom substitutions as env variables\nfor this build step. This option will override the global option\nin BuildOption.\n\n### Dir\n\n public string Dir { get; set; }\n\nWorking directory to use when running this step's container.\n\nIf this value is a relative path, it is relative to the build's working\ndirectory. If this value is absolute, it may be outside the build's working\ndirectory, in which case the contents of the path may not be persisted\nacross build step executions, unless a `volume` for that path is specified.\n\nIf the build specifies a `RepoSource` with `dir` and a step with a `dir`,\nwhich specifies an absolute path, the `RepoSource` `dir` is ignored for\nthe step's execution.\n\n### Entrypoint\n\n public string Entrypoint { get; set; }\n\nEntrypoint to be used instead of the build step image's default entrypoint.\nIf unset, the image's default entrypoint is used.\n\n### Env\n\n public RepeatedField\u003cstring\u003e Env { get; }\n\nA list of environment variable definitions to be used when running a step.\n\nThe elements are of the form \"KEY=VALUE\" for the environment variable \"KEY\"\nbeing given the value \"VALUE\".\n\n### ExitCode\n\n public int ExitCode { get; set; }\n\nOutput only. Return code from running the step.\n\n### HasAutomapSubstitutions\n\n public bool HasAutomapSubstitutions { get; }\n\nGets whether the \"automap_substitutions\" field is set\n\n### Id\n\n public string Id { get; set; }\n\nUnique identifier for this build step, used in `wait_for` to\nreference this build step as a dependency.\n\n### Name\n\n public string Name { get; set; }\n\nRequired. The name of the container image that will run this particular\nbuild step.\n\nIf the image is available in the host's Docker daemon's cache, it\nwill be run directly. If not, the host will attempt to pull the image\nfirst, using the builder service account's credentials if necessary.\n\nThe Docker daemon's cache will already have the latest versions of all of\nthe officially supported build steps\n(\u003chttps://github.com/GoogleCloudPlatform/cloud-builders\u003e).\nThe Docker daemon will also have cached many of the layers for some popular\nimages, like \"ubuntu\", \"debian\", but they will be refreshed at the time you\nattempt to use them.\n\nIf you built an image in a previous build step, it will be stored in the\nhost's Docker daemon's cache and is available to use as the name for a\nlater build step.\n\n### PullTiming\n\n public TimeSpan PullTiming { get; set; }\n\nOutput only. Stores timing information for pulling this build step's\nbuilder image only.\n\n### Script\n\n public string Script { get; set; }\n\nA shell script to be executed in the step.\n\nWhen script is provided, the user cannot specify the entrypoint or args.\n\n### SecretEnv\n\n public RepeatedField\u003cstring\u003e SecretEnv { get; }\n\nA list of environment variables which are encrypted using a Cloud Key\nManagement Service crypto key. These values must be specified in the\nbuild's `Secret`.\n\n### Status\n\n public Build.Types.Status Status { get; set; }\n\nOutput only. Status of the build step. At this time, build step status is\nonly updated on build completion; step status is not updated in real-time\nas the build progresses.\n\n### Timeout\n\n public Duration Timeout { get; set; }\n\nTime limit for executing this build step. If not defined, the step has no\ntime limit and will be allowed to continue to run until either it completes\nor the build itself times out.\n\n### Timing\n\n public TimeSpan Timing { get; set; }\n\nOutput only. Stores timing information for executing this build step.\n\n### Volumes\n\n public RepeatedField\u003cVolume\u003e Volumes { get; }\n\nList of volumes to mount into the build step.\n\nEach volume is created as an empty volume prior to execution of the\nbuild step. Upon completion of the build, volumes and their contents are\ndiscarded.\n\nUsing a named volume in only one step is not valid as it is indicative\nof a build request with an incorrect configuration.\n\n### WaitFor\n\n public RepeatedField\u003cstring\u003e WaitFor { get; }\n\nThe ID(s) of the step(s) that this build step depends on.\nThis build step will not start until all the build steps in `wait_for`\nhave completed successfully. If `wait_for` is empty, this build step will\nstart when all previous build steps in the `Build.Steps` list have\ncompleted successfully."]]