backport
Version:
A CLI tool that automates the process of backporting commits
129 lines (128 loc) • 5.46 kB
TypeScript
import type { BackportResponse } from './backport-run.js';
import { getOptionsFromGithub as _getOptionsFromGithub } from './lib/github/v4/getOptionsFromGithub/get-options-from-github.js';
import type { Commit } from './lib/sourceCommit/parse-source-commit.js';
import type { ConfigFileOptions } from './options/config-options.js';
import type { ValidConfigOptions } from './options/options.js';
export type { ErrorResult, SuccessResult } from './lib/run-sequentially.js';
export type { BackportResponse } from './backport-run.js';
export type { Commit } from './lib/sourceCommit/parse-source-commit.js';
export type { ConfigFileOptions } from './options/config-options.js';
export { getTargetBranchFromLabel } from './lib/sourceCommit/get-pull-request-states.js';
export { BackportError } from './lib/backport-error.js';
export type { BackportErrorCode, ErrorContext } from './lib/backport-error.js';
export { getGlobalConfig } from './options/config/global-config.js';
export { getProjectConfig } from './options/config/project-config.js';
export declare function getOptionsFromGithub(options: Parameters<typeof _getOptionsFromGithub>[0]): Promise<{
githubToken?: string | undefined;
assignees?: string[] | undefined;
author?: string | null | undefined;
autoAssign?: boolean | undefined;
autoFixConflicts?: import("./options/option-schema.js").AutoFixConflictsHandler | undefined;
autoMerge?: boolean | undefined;
autoMergeMethod?: "merge" | "rebase" | "squash" | undefined;
backportBinary?: string | undefined;
backportBranchName?: string | undefined;
branchLabelMapping?: Record<string, string> | undefined;
cherryPickRef?: boolean | undefined;
conflictResolution?: "commit" | "abort" | "theirs" | undefined;
commitPaths?: string[] | undefined;
copySourcePRLabels?: string | boolean | string[] | undefined;
copySourcePRReviewers?: boolean | undefined;
cwd?: string | undefined;
since?: string | null | undefined;
until?: string | null | undefined;
verbose?: boolean | undefined;
workdir?: string | undefined;
draft?: boolean | undefined;
dryRun?: boolean | undefined;
editor?: string | undefined;
fork?: boolean | undefined;
gitAuthorEmail?: string | undefined;
gitAuthorName?: string | undefined;
gitHostname?: string | undefined;
githubActionRunId?: number | undefined;
githubApiBaseUrlV3?: string | undefined;
githubApiBaseUrlV4?: string | undefined;
globalConfigFile?: string | undefined;
interactive?: boolean | undefined;
logFilePath?: string | undefined;
mainline?: number | undefined;
ls?: boolean | undefined;
maxCount?: number | undefined;
multipleBranches?: boolean | undefined;
multipleCommits?: boolean | undefined;
noVerify?: boolean | undefined;
noUnmergedBackportsHelp?: boolean | undefined;
onlyMissing?: boolean | undefined;
prDescription?: string | undefined;
prQuery?: string | undefined;
prTitle?: string | undefined;
projectConfigFile?: string | undefined;
publishStatusCommentOnAbort?: boolean | undefined;
publishStatusCommentOnFailure?: boolean | undefined;
publishStatusCommentOnSuccess?: boolean | undefined;
pullNumber?: number | number[] | undefined;
repoForkOwner?: string | undefined;
repoName?: string | undefined;
repoOwner?: string | undefined;
resetAuthor?: boolean | undefined;
reviewers?: string[] | undefined;
sha?: string | string[] | undefined;
signoff?: boolean | undefined;
skipRemoteConfig?: boolean | undefined;
sourceBranch: string;
sourcePRLabels?: string[] | undefined;
targetBranchChoices?: (string | {
name: string;
value?: string | undefined;
checked?: boolean | undefined;
})[] | undefined;
targetBranches?: string[] | undefined;
targetPRLabels?: string[] | undefined;
help?: boolean | undefined;
version?: boolean | undefined;
v?: boolean | undefined;
accessToken?: string | undefined;
upstream?: string | undefined;
branches?: (string | {
name: string;
value?: string | undefined;
checked?: boolean | undefined;
})[] | undefined;
labels?: string[] | undefined;
addOriginalReviewers?: boolean | undefined;
commitConflicts?: boolean | undefined;
autoResolveConflictsWithTheirs?: boolean | undefined;
maxNumber?: number | undefined;
prFilter?: string | undefined;
dateSince?: string | undefined;
dateUntil?: string | undefined;
dir?: string | undefined;
cherrypickRef?: boolean | undefined;
details?: boolean | undefined;
all?: boolean | undefined;
authenticatedUsername: string;
isRepoPrivate: boolean | undefined;
}>;
export declare function backportRun({ options, processArgs, exitCodeOnFailure, }: {
options?: ConfigFileOptions;
processArgs?: string[];
exitCodeOnFailure?: boolean;
}): Promise<BackportResponse>;
export declare function getCommits(options: {
githubToken: string;
repoName: string;
repoOwner: string;
author?: string;
branchLabelMapping?: ValidConfigOptions['branchLabelMapping'];
since?: string;
until?: string;
githubApiBaseUrlV4?: string;
maxCount?: number;
onlyMissing?: boolean;
prQuery?: string;
pullNumber?: number | number[];
sha?: string | string[];
skipRemoteConfig?: boolean;
sourceBranch?: string;
}): Promise<Commit[]>;