backport
Version:
A CLI tool that automates the process of backporting commits
35 lines (34 loc) • 1.28 kB
TypeScript
import { SourceCommitWithTargetPullRequestFragmentFragment } from '../../graphql/generated/graphql';
import { ValidConfigOptions } from '../../options/options';
type CreatedPullRequestState = 'CLOSED' | 'MERGED' | 'OPEN' | 'NOT_CREATED';
type CreatedPullRequest = {
url: string;
number: number;
branch: string;
state: CreatedPullRequestState;
mergeCommit?: {
sha: string;
message: string;
};
};
type TargetBranchWithLabel = {
branchLabelMappingKey: string;
branch: string;
label: string;
isSourceBranch: boolean;
};
export type TargetPullRequest = (CreatedPullRequest & Partial<TargetBranchWithLabel>) | ((TargetBranchWithLabel & Partial<CreatedPullRequest>) & {
state: CreatedPullRequestState;
});
export declare function getPullRequestStates({ sourceCommit, branchLabelMapping, }: {
sourceCommit: SourceCommitWithTargetPullRequestFragmentFragment;
branchLabelMapping: ValidConfigOptions['branchLabelMapping'];
}): TargetPullRequest[];
export declare function getTargetBranchFromLabel({ branchLabelMapping, label, }: {
branchLabelMapping: NonNullable<ValidConfigOptions['branchLabelMapping']>;
label: string;
}): {
targetBranch: string;
branchLabelMappingKey: string;
} | undefined;
export {};