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#defaults

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

Use defaults to create a map of default settings that will apply to all jobs in the workflow. You can also set default settings that are only available to a job. For more information,see jobs.<job_id>.defaults.

When more than one default setting is defined with the same name, GitHub uses the most specific default setting. For example, a default setting defined in a job will override a default setting that has the same name defined in a workflow.

defaults.run

You can use defaults.run to provide default shell and working-directory options for all run steps in a workflow. You can also set default settings for run that are only available to a job. For more information, see jobs.<job_id>.defaults.run. You cannot use contexts or expressions in this keyword.

When more than one default setting is defined with the same name, GitHub uses the most specific default setting. For example, a default setting defined in a job will override a default setting that has the same name defined in a workflow.

Set the default shell and working directory
import { workflow } from "https://deno.land/x/actionify@0.3.0/mod.ts";

const ci = workflow({ name: "ci" })
  .on("push")
  .jobs({
    "job1": (job) => {
      return job
        .defaults({ run: { shell: "bash", "working-directory": "scripts" } });
    },
  });

Parameters

defaults: WithContext<DefaultsProp, Base, "jobs:jobId:defaults:run">