1
0
mirror of https://github.com/community-scripts/ProxmoxVE.git synced 2025-03-08 13:19:05 +00:00

Update autolabeler.yml

This commit is contained in:
CanbiZ 2025-02-24 15:03:37 +01:00 committed by GitHub
parent c72e8d3da6
commit 5de3075252
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -32,7 +32,7 @@ jobs:
const autolabelerConfig = JSON.parse(fileContent); const autolabelerConfig = JSON.parse(fileContent);
const prNumber = context.payload.pull_request.number; const prNumber = context.payload.pull_request.number;
const prBody = context.payload.pull_request.body.toLowerCase(); const prBody = context.payload.pull_request.body;
// Label-Sammlung (um doppelte API-Calls zu vermeiden) // Label-Sammlung (um doppelte API-Calls zu vermeiden)
let labelsToAdd = new Set(); let labelsToAdd = new Set();
@ -70,9 +70,8 @@ jobs:
}; };
for (const [checkbox, label] of Object.entries(templateLabelMappings)) { for (const [checkbox, label] of Object.entries(templateLabelMappings)) {
const regex = new RegExp(`- \\[(.*?)\\] ${checkbox}`, "i"); const regex = new RegExp(`- \\[x\\] ${checkbox}`, "i"); // Match only checked checkboxes
const match = prBody.match(regex); if (regex.test(prBody)) {
if (match && match[1].trim() !== "") { // Checkbox ist gesetzt
labelsToAdd.add(label); labelsToAdd.add(label);
} }
} }