Interface Job
-
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
Job.Jsii$Proxy
@Generated(value="jsii-pacmak/1.62.0 (build 293ac17)", date="2022-07-16T00:20:23.461Z") @Stability(Stable) public interface Job extends software.amazon.jsii.JsiiSerializable
A GitHub Workflow job definition.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classJob.BuilderA builder forJobstatic classJob.Jsii$ProxyAn implementation forJob
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description static Job.Builderbuilder()default ObjectgetConcurrency()(experimental) Concurrency ensures that only a single job or workflow using the same concurrency group will run at a time.default ContainerOptionsgetContainer()A container to run any steps in a job that don't already specify a container.default BooleangetContinueOnError()Prevents a workflow run from failing when a job fails.default JobDefaultsgetDefaults()A map of default settings that will apply to all steps in the job.default Map<String,String>getEnv()A map of environment variables that are available to all steps in the job.default ObjectgetEnvironment()The environment that the job references.default StringgetIfValue()You can use the if conditional to prevent a job from running unless a condition is met.default StringgetName()The name of the job displayed on GitHub.default List<String>getNeeds()Identifies any jobs that must complete successfully before this job will run.default Map<String,String>getOutputs()A map of outputs for a job.JobPermissionsgetPermissions()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.ObjectgetRunsOn()The type of machine to run the job on.default Map<String,ContainerOptions>getServices()Used to host service containers for a job in a workflow.List<JobStep>getSteps()A job contains a sequence of tasks called steps.default JobStrategygetStrategy()A strategy creates a build matrix for your jobs.default NumbergetTimeoutMinutes()The maximum number of minutes to let a job run before GitHub automatically cancels it.
-
-
-
Method Detail
-
getPermissions
@Stability(Stable) @NotNull JobPermissions getPermissions()
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.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.
-
getRunsOn
@Stability(Stable) @NotNull Object getRunsOn()
The type of machine to run the job on.The machine can be either a GitHub-hosted runner or a self-hosted runner.
Example:
["ubuntu-latest"]
-
getSteps
@Stability(Stable) @NotNull List<JobStep> getSteps()
A job contains a sequence of tasks called steps.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.
-
getConcurrency
@Stability(Experimental) @Nullable default Object getConcurrency()
(experimental) 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.
-
getContainer
@Stability(Stable) @Nullable default ContainerOptions getContainer()
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.
-
getContinueOnError
@Stability(Stable) @Nullable default Boolean getContinueOnError()
Prevents a workflow run from failing when a job fails.Set to true to allow a workflow run to pass when this job fails.
-
getDefaults
@Stability(Stable) @Nullable default JobDefaults getDefaults()
A map of default settings that will apply to all steps in the job.You can also set default settings for the entire workflow.
-
getEnv
@Stability(Stable) @Nullable default Map<String,String> getEnv()
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.
-
getEnvironment
@Stability(Stable) @Nullable default Object getEnvironment()
The environment that the job references.All environment protection rules must pass before a job referencing the environment is sent to a runner.
-
getIfValue
@Stability(Stable) @Nullable default String getIfValue()
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.
-
getName
@Stability(Stable) @Nullable default String getName()
The name of the job displayed on GitHub.
-
getNeeds
@Stability(Stable) @Nullable default List<String> getNeeds()
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.
-
getOutputs
@Stability(Stable) @Nullable default Map<String,String> getOutputs()
A map of outputs for a job.Job outputs are available to all downstream jobs that depend on this job.
-
getServices
@Stability(Stable) @Nullable default Map<String,ContainerOptions> getServices()
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.
-
getStrategy
@Stability(Stable) @Nullable default JobStrategy getStrategy()
A strategy creates a build matrix for your jobs.You can define different variations to run each job in.
-
getTimeoutMinutes
@Stability(Stable) @Nullable default Number getTimeoutMinutes()
The maximum number of minutes to let a job run before GitHub automatically cancels it.Default: 360
-
builder
@Stability(Stable) static Job.Builder builder()
- Returns:
- a
Job.BuilderofJob
-
-