Skip to content

Commit 24a71c0

Browse files
committed
share a type
1 parent 10570dc commit 24a71c0

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

src/runOnPullRequest.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ import {
2121
GERALD_COMMENT_REVIEWERS_HEADER,
2222
MATCH_COMMENT_HEADER_REGEX,
2323
} from './constants';
24-
25-
type NameToLabelToFiles = {[name: string]: {[label: string]: string[], ...}, ...};
24+
import type {NameToLabelToFiles} from './utils';
2625

2726
/**
2827
* @desc Helper function to update, delete, or create a comment

src/runOnPush.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ import {getNotified, getFileDiffs, getFileContents} from './utils';
44
import {execCmd} from './execCmd';
55
import {ownerAndRepo, extraPermGithub, type Context} from './setup';
66
import {PUSH, GERALD_COMMIT_COMMENT_HEADER} from './constants';
7-
8-
type NameToLabelToFiles = {[name: string]: {[label: string]: string[], ...}, ...};
7+
import type {NameToLabelToFiles} from './utils';
98

109
const makeCommitComment = async (peopleToLabelToFiles: NameToLabelToFiles, commitSHA: string) => {
1110
const names: string[] = Object.keys(peopleToLabelToFiles);

src/utils.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,10 @@ import {
3636

3737
type Section = 'pull_request' | 'push';
3838
type GeraldFile = 'NOTIFIED' | 'REVIEWERS';
39-
type NameToLabelToFiles = {[name: string]: {[label: string]: string[], ...}, ...};
4039
type CommentHeaders = 'Reviewers' | 'Required Reviewers' | 'Notified';
4140

41+
export type NameToLabelToFiles = {[name: string]: {[label: string]: string[], ...}, ...};
42+
4243
/**
4344
* @desc Make the comment body for each of the Gerald sections.
4445
*

0 commit comments

Comments
 (0)