Class JobCallingReusableWorkflow.Builder
- java.lang.Object
-
- io.github.cdklabs.projen.github.workflows.JobCallingReusableWorkflow.Builder
-
- All Implemented Interfaces:
software.amazon.jsii.Builder<JobCallingReusableWorkflow>
- Enclosing interface:
- JobCallingReusableWorkflow
@Stability(Experimental) public static final class JobCallingReusableWorkflow.Builder extends Object implements software.amazon.jsii.Builder<JobCallingReusableWorkflow>
A builder forJobCallingReusableWorkflow
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
-
-
-
Method Detail
-
uses
@Stability(Experimental) public JobCallingReusableWorkflow.Builder uses(String uses)
Sets the value ofJobCallingReusableWorkflow.getUses()- Parameters:
uses- The location and version of a reusable workflow file to run as a job. This parameter is required.- Returns:
this
-
secrets
@Stability(Experimental) public JobCallingReusableWorkflow.Builder secrets(String secrets)
Sets the value ofJobCallingReusableWorkflow.getSecrets()- Parameters:
secrets- When a job is used to call a reusable workflow, you can use secrets to provide a map of secrets that are passed to the called workflow. Use the 'inherit' keyword to pass all the calling workflow's secrets to the called workflow- Returns:
this
-
secrets
@Stability(Experimental) public JobCallingReusableWorkflow.Builder secrets(Map<String,String> secrets)
Sets the value ofJobCallingReusableWorkflow.getSecrets()- Parameters:
secrets- When a job is used to call a reusable workflow, you can use secrets to provide a map of secrets that are passed to the called workflow. Use the 'inherit' keyword to pass all the calling workflow's secrets to the called workflow- Returns:
this
-
with
@Stability(Experimental) public JobCallingReusableWorkflow.Builder with(Map<String,? extends Object> with)
Sets the value ofJobCallingReusableWorkflow.getWith()- Parameters:
with- When a job is used to call a reusable workflow, you can use with to provide a map of inputs that are passed to the called workflow. Allowed expression contexts:github, andneeds.- Returns:
this
-
permissions
@Stability(Experimental) public JobCallingReusableWorkflow.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 JobCallingReusableWorkflow.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 JobCallingReusableWorkflow.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 JobCallingReusableWorkflow.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 JobCallingReusableWorkflow.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 JobCallingReusableWorkflow.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 JobCallingReusableWorkflow build()
Builds the configured instance.- Specified by:
buildin interfacesoftware.amazon.jsii.Builder<JobCallingReusableWorkflow>- Returns:
- a new instance of
JobCallingReusableWorkflow - Throws:
NullPointerException- if any required attribute was not provided
-
-