Skip to content

Commit

Permalink
share a type
Browse files Browse the repository at this point in the history
  • Loading branch information
csilvers committed Nov 12, 2024
1 parent 10570dc commit 24a71c0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions src/runOnPullRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ import {
GERALD_COMMENT_REVIEWERS_HEADER,
MATCH_COMMENT_HEADER_REGEX,
} from './constants';

type NameToLabelToFiles = {[name: string]: {[label: string]: string[], ...}, ...};
import type {NameToLabelToFiles} from './utils';

/**
* @desc Helper function to update, delete, or create a comment
Expand Down
3 changes: 1 addition & 2 deletions src/runOnPush.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import {getNotified, getFileDiffs, getFileContents} from './utils';
import {execCmd} from './execCmd';
import {ownerAndRepo, extraPermGithub, type Context} from './setup';
import {PUSH, GERALD_COMMIT_COMMENT_HEADER} from './constants';

type NameToLabelToFiles = {[name: string]: {[label: string]: string[], ...}, ...};
import type {NameToLabelToFiles} from './utils';

const makeCommitComment = async (peopleToLabelToFiles: NameToLabelToFiles, commitSHA: string) => {
const names: string[] = Object.keys(peopleToLabelToFiles);
Expand Down
3 changes: 2 additions & 1 deletion src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@ import {

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

export type NameToLabelToFiles = {[name: string]: {[label: string]: string[], ...}, ...};

/**
* @desc Make the comment body for each of the Gerald sections.
*
Expand Down

0 comments on commit 24a71c0

Please sign in to comment.