Class JobStep.Builder
- java.lang.Object
-
- io.github.cdklabs.projen.github.workflows.JobStep.Builder
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JobStepbuild()Builds the configured instance.JobStep.BuildercontinueOnError(Boolean continueOnError)Sets the value ofJobStepConfiguration.getContinueOnError()JobStep.Builderenv(Map<String,String> env)Sets the value ofJobStep.getEnv()JobStep.Builderid(String id)Sets the value ofJobStep.getId()JobStep.BuilderifValue(String ifValue)Sets the value ofJobStep.getIfValue()JobStep.Buildername(String name)Sets the value ofJobStep.getName()JobStep.Builderrun(String run)Sets the value ofStep.getRun()JobStep.BuildertimeoutMinutes(Number timeoutMinutes)Sets the value ofJobStepConfiguration.getTimeoutMinutes()JobStep.Builderuses(String uses)Sets the value ofStep.getUses()JobStep.Builderwith(Map<String,? extends Object> with)Sets the value ofStep.getWith()JobStep.BuilderworkingDirectory(String workingDirectory)Sets the value ofJobStep.getWorkingDirectory()
-
-
-
Method Detail
-
run
@Stability(Experimental) public JobStep.Builder run(String run)
Sets the value ofStep.getRun()- Parameters:
run- Runs command-line programs using the operating system's shell. If you do not provide a name, the step name will default to the text specified in the run command.- Returns:
this
-
uses
@Stability(Experimental) public JobStep.Builder uses(String uses)
Sets the value ofStep.getUses()- Parameters:
uses- Selects an action to run as part of a step in your job. An action is a reusable unit of code. You can use an action defined in the same repository as the workflow, a public repository, or in a published Docker container image.- Returns:
this
-
with
@Stability(Experimental) public JobStep.Builder with(Map<String,? extends Object> with)
Sets the value ofStep.getWith()- Parameters:
with- A map of the input parameters defined by the action. Each input parameter is a key/value pair. Input parameters are set as environment variables. The variable is prefixed with INPUT_ and converted to upper case.- Returns:
this
-
env
@Stability(Experimental) public JobStep.Builder env(Map<String,String> env)
Sets the value ofJobStep.getEnv()- Parameters:
env- Sets environment variables for steps to use in the runner environment. You can also set environment variables for the entire workflow or a job.- Returns:
this
-
id
@Stability(Experimental) public JobStep.Builder id(String id)
Sets the value ofJobStep.getId()- Parameters:
id- A unique identifier for the step. You can use the id to reference the step in contexts.- Returns:
this
-
ifValue
@Stability(Experimental) public JobStep.Builder ifValue(String ifValue)
Sets the value ofJobStep.getIfValue()- Parameters:
ifValue- You can use the if conditional to prevent a job from running unless a condition is met. You can use any supported context and expression to create a conditional.- Returns:
this
-
name
@Stability(Experimental) public JobStep.Builder name(String name)
Sets the value ofJobStep.getName()- Parameters:
name- A name for your step to display on GitHub.- Returns:
this
-
workingDirectory
@Stability(Experimental) public JobStep.Builder workingDirectory(String workingDirectory)
Sets the value ofJobStep.getWorkingDirectory()- Parameters:
workingDirectory- Specifies a working directory for a step. Overrides a job's working directory.- Returns:
this
-
continueOnError
@Stability(Experimental) public JobStep.Builder continueOnError(Boolean continueOnError)
Sets the value ofJobStepConfiguration.getContinueOnError()- Parameters:
continueOnError- Prevents a job from failing when a step fails. Set to true to allow a job to pass when this step fails.- Returns:
this
-
timeoutMinutes
@Stability(Experimental) public JobStep.Builder timeoutMinutes(Number timeoutMinutes)
Sets the value ofJobStepConfiguration.getTimeoutMinutes()- Parameters:
timeoutMinutes- The maximum number of minutes to run the step before killing the process.- Returns:
this
-
build
@Stability(Experimental) public JobStep build()
Builds the configured instance.- Specified by:
buildin interfacesoftware.amazon.jsii.Builder<JobStep>- Returns:
- a new instance of
JobStep - Throws:
NullPointerException- if any required attribute was not provided
-
-