mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2025-09-13 07:10:51 +02:00
[gh] Furhter Impove Changelog Workflow (#2655)
* Impove Workflow * Impove Workflow
This commit is contained in:
committed by
GitHub
parent
a971cedde5
commit
46462a790c
39
.github/workflows/autolabeler.yml
vendored
39
.github/workflows/autolabeler.yml
vendored
@@ -11,7 +11,7 @@ jobs:
|
||||
permissions:
|
||||
pull-requests: write
|
||||
env:
|
||||
CONFIG_PATH: .github/autolabeler-config.json
|
||||
CONFIG_PATH: .github/autolabeler-config_new.json
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
@@ -43,26 +43,8 @@ jobs:
|
||||
});
|
||||
const prFiles = prListFilesResponse.data;
|
||||
|
||||
const templateLabelMappings = {
|
||||
"🐞 **bug fix**": "bugfix",
|
||||
"✨ **new feature**": "feature",
|
||||
"💥 **breaking change**": "breaking change",
|
||||
"🆕 **new script**": "new script"
|
||||
};
|
||||
|
||||
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);
|
||||
if (match) {
|
||||
console.log(`Match: ${match}`);
|
||||
labelsToAdd.add(label);
|
||||
}
|
||||
}
|
||||
if (labelsToAdd.size === 0) {
|
||||
labelsToAdd.add("general");
|
||||
}
|
||||
|
||||
|
||||
// Apply labels based on file changes
|
||||
for (const [label, rules] of Object.entries(autolabelerConfig)) {
|
||||
const shouldAddLabel = prFiles.some((prFile) => {
|
||||
@@ -79,6 +61,21 @@ jobs:
|
||||
labelsToAdd.add(label);
|
||||
}
|
||||
}
|
||||
const templateLabelMappings = {
|
||||
"🐞 **Bug fix**": "bugfix",
|
||||
"✨ **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);
|
||||
if (match) {
|
||||
console.log(`Match: ${match}`);
|
||||
labelsToAdd.add(label);
|
||||
}
|
||||
}
|
||||
|
||||
console.log(`Labels to add: ${Array.from(labelsToAdd).join(", ")}`);
|
||||
|
||||
@@ -90,4 +87,4 @@ jobs:
|
||||
issue_number: prNumber,
|
||||
labels: Array.from(labelsToAdd),
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user