Skip to content

Commit

Permalink
feat(label-checker): add checkerExemptionLabels support (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
sumire88 authored Jan 11, 2024
1 parent cc4f943 commit 32dfbc4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/constant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,11 @@ export const defaultLables = [
"api",
];

export const checkerExemptionLabels = [
"style",
"fixture",
"chore",
"documentation",
];

export const strictLabels = defaultLables.slice(0, -5);
6 changes: 5 additions & 1 deletion src/handlers/check_pr_tested_label.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
Result,
} from "../common";
import { constructMetadata } from "../events/metadata";
import { checkerExemptionLabels } from "../constant";

const check_run_name = `${process.env.APP_NAME} / check_pr_tested_label`;

Expand Down Expand Up @@ -61,7 +62,10 @@ Processing
if (
metadata.pull_request.labels
.map((label: any) => label.name)
.includes("tested")
.includes("tested") &&
metadata.pull_request.labels.some((label: string) =>
checkerExemptionLabels.includes(label),
)
) {
// valid format
app.log.info(`Check passed, label 'tested' is present, proceed`);
Expand Down

0 comments on commit 32dfbc4

Please sign in to comment.