mirror of
https://github.com/storybookjs/storybook.git
synced 2025-03-15 05:02:24 +08:00
allow patch:done with patch:yes and patch:no labels
This commit is contained in:
parent
fbf7b85b54
commit
a9a911997d
@ -41,18 +41,18 @@ const checkRequiredLabels = (labels: string[]) => {
|
||||
);
|
||||
}
|
||||
|
||||
const foundLabels = intersection(requiredLabels, labels);
|
||||
if (isEmpty(foundLabels)) {
|
||||
const foundRequiredLabels = intersection(requiredLabels, labels);
|
||||
if (isEmpty(foundRequiredLabels)) {
|
||||
fail(`PR is not labeled with one of: ${JSON.stringify(requiredLabels)}`);
|
||||
} else if (foundLabels.length > 1) {
|
||||
fail(`Please choose only one of these labels: ${JSON.stringify(foundLabels)}`);
|
||||
} else if (foundRequiredLabels.length > 1) {
|
||||
fail(`Please choose only one of these labels: ${JSON.stringify(foundRequiredLabels)}`);
|
||||
}
|
||||
|
||||
const patchLabels = ['patch:no', 'patch:yes', '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 foundPatchLabels = intersection(['patch:no', 'patch:yes'], labels);
|
||||
if (isEmpty(foundPatchLabels)) {
|
||||
fail(`PR is not labeled with one of: ${JSON.stringify(foundPatchLabels)}`);
|
||||
} else if (foundPatchLabels.length > 1) {
|
||||
fail(`Please choose only one of these labels: ${JSON.stringify(foundPatchLabels)}`);
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user