| Constructor and Description |
|---|
Builder() |
@Stability(value=Experimental) public Job.Builder permissions(JobPermissions permissions)
Job.getPermissions()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.
this@Stability(value=Experimental) public Job.Builder runsOn(List<String> runsOn)
Job.getRunsOn()runsOn - The type of machine to run the job on. This parameter is required.
The machine can be either a
GitHub-hosted runner or a self-hosted runner.this@Stability(value=Experimental) public Job.Builder steps(List<? extends JobStep> steps)
Job.getSteps()steps - A job contains a sequence of tasks called steps. This parameter is required.
Steps can run commands,
run setup tasks, or run an action in your repository, a public repository,
or an action published in a Docker registry. Not all steps run actions,
but all actions run as a step. Each step runs in its own process in the
runner environment and has access to the workspace and filesystem.
Because steps run in their own process, changes to environment variables
are not preserved between steps. GitHub provides built-in steps to set up
and complete a job.this@Stability(value=Experimental) public Job.Builder concurrency(Object concurrency)
Job.getConcurrency()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.this@Stability(value=Experimental) public Job.Builder container(ContainerOptions container)
Job.getContainer()container - A container to run any steps in a job that don't already specify a container.
If you have steps that use both script and container actions,
the container actions will run as sibling containers on the same network
with the same volume mounts.this@Stability(value=Experimental) public Job.Builder continueOnError(Boolean continueOnError)
Job.getContinueOnError()continueOnError - Prevents a workflow run from failing when a job fails.
Set to true to
allow a workflow run to pass when this job fails.this@Stability(value=Experimental) public Job.Builder defaults(JobDefaults defaults)
Job.getDefaults()defaults - A map of default settings that will apply to all steps in the job.
You
can also set default settings for the entire workflow.this@Stability(value=Experimental) public Job.Builder env(Map<String,String> env)
Job.getEnv()env - A map of environment variables that are available to all steps in the job.
You can also set environment variables for the entire workflow or an
individual step.this@Stability(value=Experimental) public Job.Builder environment(Object environment)
Job.getEnvironment()environment - The environment that the job references.
All environment protection rules
must pass before a job referencing the environment is sent to a runner.this@Stability(value=Experimental) public Job.Builder ifValue(String ifValue)
Job.getIfValue()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.this@Stability(value=Experimental) public Job.Builder name(String name)
Job.getName()name - The name of the job displayed on GitHub.this@Stability(value=Experimental) public Job.Builder needs(List<String> needs)
Job.getNeeds()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.this@Stability(value=Experimental) public Job.Builder outputs(Map<String,? extends JobStepOutput> outputs)
Job.getOutputs()outputs - A map of outputs for a job.
Job outputs are available to all downstream
jobs that depend on this job.this@Stability(value=Experimental) public Job.Builder services(Map<String,? extends ContainerOptions> services)
Job.getServices()services - Used to host service containers for a job in a workflow.
Service
containers are useful for creating databases or cache services like Redis.
The runner automatically creates a Docker network and manages the life
cycle of the service containers.this@Stability(value=Experimental) public Job.Builder strategy(JobStrategy strategy)
Job.getStrategy()strategy - A strategy creates a build matrix for your jobs.
You can define different
variations to run each job in.this@Stability(value=Experimental) public Job.Builder timeoutMinutes(Number timeoutMinutes)
Job.getTimeoutMinutes()timeoutMinutes - The maximum number of minutes to let a job run before GitHub automatically cancels it.this@Stability(value=Experimental) public Job build()
build in interface software.amazon.jsii.Builder<Job>JobNullPointerException - if any required attribute was not providedCopyright © 2021. All rights reserved.