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

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

The location and version of a reusable workflow file to run as a job. Use one of the following syntaxes:

  • {owner}/{repo}/.github/workflows/{filename}@{ref} for reusable workflows in public repositories.
  • ./.github/workflows/{filename} for reusable workflows in the same repository. {ref} can be a SHA, a release tag, or a branch name. Using the commit SHA is the safest for stability and security. For more information, see "Security hardening for GitHub Actions." If you use the second syntax option (without {owner}/{repo} and @{ref}) the called workflow is from the same commit as the caller workflow.
import { workflow } from 'https://deno.land/x/actionify@0.3.0/mod.ts';

const ci = workflow({ name: 'ci' })
  .job('call-workflow-1-in-local-repo', (job) => {
    return job
      .uses('octo-org/this-repo/.github/workflows/workflow-1.yml@172239021f7ba04fe7327647b213799853a9eb89')
  })
  .job('call-workflow-2-in-local-repo', (job) => {
    return job.uses('./.github/workflows/workflow-2.yml')
  })
  .job('call-workflow-in-another-repo', (job) => {
    return job.uses('octo-org/another-repo/.github/workflows/workflow.yml@v1')
  });

For more information, see "Reusing workflows."

Parameters

uses: string | Workflow

Returns

Job<CombineAsUnion<Base | ExtractFromWorkflow<Workflow>>>