UNPKG

1.87 kBTypeScriptView Raw
1import { IExtendedCommit } from "./log-parse";
2interface ISearchEdge {
3 /** Graphql search node */
4 node: {
5 /** PR number */
6 number: number;
7 /** State of the PR */
8 state: "MERGED" | "CLOSED" | "OPEN";
9 /** Body of the PR */
10 body: string;
11 /** Name of the branch the PR was made from */
12 headRefName: string;
13 /** Use of the fork the PR was made from */
14 headRepositoryOwner: {
15 /** Username of the owner of the fork the PR was made from */
16 login: string;
17 };
18 /** Labels attached to the PR */
19 labels: {
20 /** Edges of the Query */
21 edges: [{
22 /** Graphql search node */
23 node: {
24 /** Name of the label */
25 name: string;
26 };
27 }];
28 };
29 };
30}
31export interface ISearchResult {
32 /** Results in the search */
33 edges: ISearchEdge[];
34}
35/**
36 * Generate a GitHub graphql query to find all the commits related
37 * to a PR.
38 */
39export declare function buildSearchQuery(owner: string, project: string, commits: string[]): string | undefined;
40/** Use the graphql query result to fill in more information about a commit */
41export declare function processQueryResult({ owner, sha, result, commitsWithoutPR, prereleaseBranches, }: {
42 /** The owner of the main fork of the repo to automate releases for */
43 owner: string;
44 /** The commit sha to process */
45 sha: string;
46 /** The graphql response for the search query hash */
47 result: ISearchResult;
48 /** Commits that do not yet have a PR matched to them */
49 commitsWithoutPR: IExtendedCommit[];
50 /** Branches to treat as pre-releases */
51 prereleaseBranches: string[];
52}): IExtendedCommit | undefined;
53export {};
54//# sourceMappingURL=match-sha-to-pr.d.ts.map
\No newline at end of file