Changes to Workfows

This commit is contained in:
Michel Roegl-Brunner
2025-05-13 14:19:16 +02:00
parent 98daf9bc56
commit c3f73291a3
14 changed files with 96 additions and 89 deletions

View File

@@ -7,6 +7,7 @@ on:
jobs:
autolabeler:
if: github.repository == 'community-scripts/ProxmoxVED'
runs-on: ubuntu-latest
permissions:
pull-requests: write
@@ -42,9 +43,9 @@ jobs:
pull_number: prNumber,
});
const prFiles = prListFilesResponse.data;
// Apply labels based on file changes
for (const [label, rules] of Object.entries(autolabelerConfig)) {
const shouldAddLabel = prFiles.some((prFile) => {
@@ -66,17 +67,17 @@ jobs:
"✨ **New feature**": "feature",
"💥 **Breaking change**": "breaking change",
};
for (const [checkbox, label] of Object.entries(templateLabelMappings)) {
const escapedCheckbox = checkbox.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1");
const regex = new RegExp(`- \\[(x|X)\\]\\s*.*${escapedCheckbox}`, "i");
const match = prBody.match(regex);
const match = prBody.match(regex);
if (match) {
console.log(`Match: ${match}`);
labelsToAdd.add(label);
}
}
console.log(`Labels to add: ${Array.from(labelsToAdd).join(", ")}`);
if (labelsToAdd.size > 0) {