A conditional to prevent a job from running unless a condition is met.
You can use any supported context and expression to create a conditional.
For more information on which contexts are supported in this key, see
Contexts reference.
Identify any jobs that must complete successfully before this job will run.
It can be a string or array of strings.
If a job fails or is skipped, all jobs that need it are skipped unless the jobs use a conditional expression that
causes the job to continue.
If a run contains a series of jobs that need each other, a failure or skip applies to all jobs in the dependency
chain from the point of failure or skip onwards. If you would like a job to run even if a job it is dependent on
did not succeed, use the always() conditional expression in jobs.<job_id>.if.
Ensure 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. Allowed expression contexts: github, inputs, vars,
needs, strategy, and matrix.
For more information about expressions, see
Evaluate expressions in workflows and actions.
You can also specify concurrency at the workflow level.
For more information, see module.concurrency.
This means that there can be at most one running and one pending job in a concurrency group at any time.
When a concurrent job or workflow is queued, if another job or workflow using the same concurrency group in the
repository is in progress, the queued job or workflow will be pending.
Any existing pending job or workflow in the same concurrency group, if it exists, will be canceled and the new
queued job or workflow will take its place.
To also cancel any currently running job or workflow in the same concurrency group, specify cancel-in-progress = true.
To conditionally cancel currently running jobs or workflows in the same concurrency group, you can specify
cancel-in-progress as an expression with any of the allowed expression contexts.
Note:
The concurrency group name is case insensitive. For example, prod and Prod will be treated as the same concurrency group.
Ordering is not guaranteed for jobs or workflow runs using concurrency groups. Jobs or workflow runs in the same concurrency group are handled in an arbitrary order.
Use jobs.<job_id>.strategy to use a matrix strategy for your jobs.
A matrix strategy lets you use variables in a single job definition to automatically create multiple job runs that
are based on the combinations of the variables.
For example, you can use a matrix strategy to test your code in multiple versions of a language or on multiple
operating systems.
For a specific job, you can use jobs.<job_id>.permissions to modify the default permissions granted to the
GITHUB_TOKEN, adding or removing access as required, so that you only allow the minimum required access.
For more information, see Use GITHUB_TOKEN for authentication in workflows.
By specifying the permission within a job definition, you can configure a different set of permissions for the
GITHUB_TOKEN for each job, if required.
Alternatively, you can specify the permissions for all jobs in the workflow.
For information on defining permissions at the workflow level, see module.permissions.
For each of the available permissions, shown in the table below, you can assign one of the access levels:
read (if applicable), write, or none. write includes read. If you specify the access for any of these permissions,
all of those that are not specified are set to none.
A name for the job, which is displayed in the GitHub UI