Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/actionify/src/job.ts>Job#needs

Create and manage your GitHub workflows with TypeScript and Deno.
Latest
method Job.prototype.needs
import { Job } from "https://deno.land/x/actionify@0.3.0/src/job.ts";

Use jobs.<job_id>.needs to 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, 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 applies to all jobs in the dependency chain from the point of failure onwards.

Requiring successful dependent jobs

import { workflow } from 'https://deno.land/x/actionify@0.3.0/mod.ts';

const ci = workflow({ name: "ci", fileName: "ci" })
  .job('a', (job) => job.name('A'))
  .job('b', (job) => job.name('B'))
  .job('c', (job) => job.name('C').needs('a'))
  .job('d', (job) => job.name('D').needs(["a", "b", "c"]));

Type Parameters

Name extends NonNullable<Base["jobs"]>

Returns

Job<CombineAsUnion<Base | { needs: Name; }>>