Jobs wrap your tasks, providing a runner and a context for your tasks to run in.
Using tasks directly - You can run tasks without wrapping with a job. A default job with the "ubuntu-4x" runner is created for you.
Example
.pandaci/example.workflow.ts
Methods
job.if
The if
method allows you to skip a job based on a condition.
job.nothrow
The nothrow
method allows you to suppress errors if the condition is met.
job.skip
The skip
method allows you to skip a job if the condition is met.
Job options
- runner - The runner to use for this job. Defaults to "ubuntu-4x".
- skip - Skip this job if the condition is met. Defaults to false.
- throws - Throw an error if the condition is met. Defaults to true.
Return value
JobPromise
The promise returned when a job is awaited. It's an extension of Promise<JobResult>
.
JobResult
The result of a job. This is whats returned when a job is awaited.
Property | Type | Description |
---|---|---|
name | string | The name of the job. |
conclusion | Conclusion ('success' | 'failure' | 'skipped') | The conclusion of the job. |
isFailure | boolean | True if the job failed. |
isSuccess | boolean | True if the job succeeded. |
isSkipped | boolean | True if the job was skipped. |
id | string | The id of the job. |
runner | string | The runner used for the job. |
JobError
Thrown when a job fails.
Property | Type | Description |
---|---|---|
conclusion | Conclusion ('success' | 'failure' | 'skipped') | The conclusion of the job. |
isFailure | boolean | True if the job failed. |
isSuccess | boolean | True if the job succeeded. |
isSkipped | boolean | True if the job was skipped. |
id | string | The id of the job. |
runner | string | The runner used for the job. |
jobName | string | The name of the job. |