allow patch:done with patch:yes and patch:no labels

This commit is contained in:
Jeppe Reinhold 2023-07-11 14:45:44 +02:00
parent fbf7b85b54
commit a9a911997d

View File

@ -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)}`);
}
};