Class CommonJobDefinition.Builder
- java.lang.Object
-
- io.github.cdklabs.projen.github.workflows.CommonJobDefinition.Builder
-
- All Implemented Interfaces:
software.amazon.jsii.Builder<CommonJobDefinition>
- Enclosing interface:
- CommonJobDefinition
@Stability(Experimental) public static final class CommonJobDefinition.Builder extends Object implements software.amazon.jsii.Builder<CommonJobDefinition>
A builder forCommonJobDefinition
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CommonJobDefinitionbuild()Builds the configured instance.CommonJobDefinition.Builderconcurrency(Object concurrency)Sets the value ofCommonJobDefinition.getConcurrency()CommonJobDefinition.BuilderifValue(String ifValue)Sets the value ofCommonJobDefinition.getIfValue()CommonJobDefinition.Buildername(String name)Sets the value ofCommonJobDefinition.getName()CommonJobDefinition.Builderneeds(List<String> needs)Sets the value ofCommonJobDefinition.getNeeds()CommonJobDefinition.Builderpermissions(JobPermissions permissions)Sets the value ofCommonJobDefinition.getPermissions()CommonJobDefinition.Builderstrategy(JobStrategy strategy)Sets the value ofCommonJobDefinition.getStrategy()
-
-
-
Method Detail
-
permissions
@Stability(Experimental) public CommonJobDefinition.Builder permissions(JobPermissions permissions)
Sets the value ofCommonJobDefinition.getPermissions()- Parameters:
permissions- You can modify the default permissions granted to the GITHUB_TOKEN, adding or removing access as required, so that you only allow the minimum required access. This parameter is required. Use{ contents: READ }if your job only needs to clone code.This is intentionally a required field since it is required in order to allow workflows to run in GitHub repositories with restricted default access.
- Returns:
this
-
concurrency
@Stability(Experimental) public CommonJobDefinition.Builder concurrency(Object concurrency)
Sets the value ofCommonJobDefinition.getConcurrency()- Parameters:
concurrency- Concurrency ensures that only a single job or workflow using the same concurrency group will run at a time. A concurrency group can be any string or expression. The expression can use any context except for the secrets context.- Returns:
this
-
ifValue
@Stability(Experimental) public CommonJobDefinition.Builder ifValue(String ifValue)
Sets the value ofCommonJobDefinition.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 CommonJobDefinition.Builder name(String name)
Sets the value ofCommonJobDefinition.getName()- Parameters:
name- The name of the job displayed on GitHub.- Returns:
this
-
needs
@Stability(Experimental) public CommonJobDefinition.Builder needs(List<String> needs)
Sets the value ofCommonJobDefinition.getNeeds()- Parameters:
needs- Identifies any jobs that must complete successfully before this job will run. It can be a string or array of strings. If a job fails, all jobs that need it are skipped unless the jobs use a conditional expression that causes the job to continue.- Returns:
this
-
strategy
@Stability(Experimental) public CommonJobDefinition.Builder strategy(JobStrategy strategy)
Sets the value ofCommonJobDefinition.getStrategy()- Parameters:
strategy- A strategy creates a build matrix for your jobs. You can define different variations to run each job in.- Returns:
this
-
build
@Stability(Experimental) public CommonJobDefinition build()
Builds the configured instance.- Specified by:
buildin interfacesoftware.amazon.jsii.Builder<CommonJobDefinition>- Returns:
- a new instance of
CommonJobDefinition - Throws:
NullPointerException- if any required attribute was not provided
-
-