feat(dev-infra): handle excluding files via globs in pullapprove (#36162)

Updates the pullapprove verification script to handle
cases of excluding globs from groups.

PR Close #36162
This commit is contained in:
Joey Perrott
2020-03-20 06:59:35 -07:00
committed by Alex Rickabaugh
parent bfa7b1a494
commit 83e4a76afa
5 changed files with 326 additions and 185 deletions

View File

@ -0,0 +1,33 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {parse as parseYaml} from 'yaml';
export interface PullApproveGroupConfig {
conditions: string;
reviewers: {
users: string[],
teams: string[],
};
}
export interface PullApproveConfig {
version: number;
github_api_version?: string;
pullapprove_conditions?: {
condition: string,
unmet_status: string,
explanation: string,
}[];
groups: {
[key: string]: PullApproveGroupConfig,
};
}
export function parsePullApproveYaml(rawYaml: string): PullApproveConfig {
return parseYaml(rawYaml) as PullApproveConfig;
}