UNPKG

backport

Version:

A CLI tool that automates the process of backporting commits

30 lines (29 loc) 1.06 kB
/** Iterates target branches, calling cherrypickAndCreateTargetPullRequest for each, collecting Result[]. */ import type { ValidConfigOptions } from '../options/options.js'; import type { BackportErrorCode, ErrorContext } from './backport-error.js'; import type { Commit } from './sourceCommit/parse-source-commit.js'; export type SuccessResult = { status: 'success'; targetBranch: string; pullRequestUrl: string; pullRequestNumber: number; }; export type ErrorResult<TCode extends BackportErrorCode = BackportErrorCode> = { status: 'error'; targetBranch?: string; errorMessage: string; errorCode: TCode | 'unhandled-exception'; errorContext?: Extract<ErrorContext, { code: TCode; }>; }; export type Result = SuccessResult | ErrorResult; export type BackportResponse = { commits: Commit[]; results: Result[]; }; export declare function runSequentially({ options, commits, targetBranches, }: { options: ValidConfigOptions; commits: Commit[]; targetBranches: string[]; }): Promise<Result[]>;