UNPKG

backport

Version:

A CLI tool that automates the process of backporting commits

35 lines (34 loc) 1.29 kB
import type { SourceCommitWithTargetPullRequestFragmentFragment } from '../../graphql/generated/graphql.js'; import type { ValidConfigOptions } from '../../options/options.js'; 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 {};