Skip to content

Commit

Permalink
Require either 'patch' or 'no-patch' label
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinpalkovic committed Jul 7, 2023
1 parent 1f782f3 commit 8663fe9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions scripts/dangerfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ const checkRequiredLabels = (labels: string[]) => {
} else if (foundLabels.length > 1) {
fail(`Please choose only one of these labels: ${JSON.stringify(foundLabels)}`);
}

const patchLabels = ['patch', 'patch:no', 'patch:done'];
if (isEmpty(intersection(patchLabels, labels))) {
fail(`PR is not labeled with one of: ${JSON.stringify(patchLabels)}`);
} else if (foundLabels.length > 1) {
fail(`Please choose only one of these labels: ${JSON.stringify(foundLabels)}`);
}
};

const checkPrTitle = (title: string) => {
Expand Down

0 comments on commit 8663fe9

Please sign in to comment.