import { Job, type JobDef, type JobDefaults } from "./job.js"; import type { Permissions } from "./permissions.js"; import { type ConfigValue } from "./step.js"; import { type WriteOrLintOptions } from "./write.js"; /** An input declared by a `workflow_call` trigger. */ export interface WorkflowCallInput { type: "string" | "boolean" | "number"; description?: string; required?: boolean; default?: string | boolean | number; } /** An output declared by a `workflow_call` trigger. */ export interface WorkflowCallOutput { description?: string; value: string; } /** A secret declared by a `workflow_call` trigger. */ export interface WorkflowCallSecret { description?: string; required?: boolean; } /** The `workflow_call` trigger, which makes a workflow reusable. */ export interface WorkflowCallTrigger { inputs?: Record; outputs?: Record; secrets?: Record; } /** * The events a workflow runs on. Unknown events are passed through as-is, with * camelCased keys converted to their kebab-cased YAML form. */ export interface WorkflowTriggers { push?: { branches?: string[]; branchesIgnore?: string[]; tags?: string[]; tagsIgnore?: string[]; paths?: string[]; pathsIgnore?: string[]; }; pull_request?: { branches?: string[]; branchesIgnore?: string[]; types?: string[]; paths?: string[]; pathsIgnore?: string[]; }; workflow_dispatch?: Record; workflow_call?: WorkflowCallTrigger; schedule?: { cron: string; }[]; [key: string]: unknown; } /** A workflow definition. */ export interface WorkflowConfig { name: string; runName?: string; on: WorkflowTriggers | string[]; permissions?: Permissions; concurrency?: { group: string; cancelInProgress?: boolean | string; }; env?: Record; defaults?: JobDefaults; jobs?: (JobDef | Job)[]; } /** * A resolved workflow. Prefer the `workflow()` free function over constructing * this directly. */ export declare class Workflow { #private; constructor(config: WorkflowConfig); /** Serializes the workflow to GitHub Actions YAML. */ toYamlString(options?: { header?: string; }): string; /** Writes the workflow's YAML to a file. */ writeToFile(path: string | URL, options?: { header?: string; }): void; /** * Writes the workflow's YAML to `options.filePath`, or with `--lint` verifies * the file there is up to date. See {@link writeOrLintYaml}. */ writeOrLint(options: WriteOrLintOptions): void; } /** Creates a workflow from the given configuration. */ export declare function workflow(config: WorkflowConfig): Workflow; //# sourceMappingURL=workflow.d.ts.map