mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2025-03-08 13:19:05 +00:00
[gh] Furhter Impove Changelog Workflow (#2655)
* Impove Workflow * Impove Workflow
This commit is contained in:
parent
a971cedde5
commit
46462a790c
55
.github/autolabeler-config.json
vendored
55
.github/autolabeler-config.json
vendored
@ -1,17 +1,5 @@
|
|||||||
|
|
||||||
{
|
{
|
||||||
"breaking change": [
|
|
||||||
{
|
|
||||||
"fileStatus": "renamed",
|
|
||||||
"includeGlobs": ["ct/**", "install/**", "misc/**", "turnkey/**", "vm/**"],
|
|
||||||
"excludeGlobs": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fileStatus": "removed",
|
|
||||||
"includeGlobs": ["ct/**", "install/**", "misc/**", "turnkey/**", "vm/**"],
|
|
||||||
"excludeGlobs": []
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"new script": [
|
"new script": [
|
||||||
{
|
{
|
||||||
"fileStatus": "added",
|
"fileStatus": "added",
|
||||||
@ -33,10 +21,17 @@
|
|||||||
"excludeGlobs": []
|
"excludeGlobs": []
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"rename script": [
|
"maintenance": [
|
||||||
{
|
{
|
||||||
"fileStatus": "renamed",
|
"fileStatus": null,
|
||||||
"includeGlobs": ["ct/**", "install/**", "misc/**", "turnkey/**", "vm/**"],
|
"includeGlobs": ["*.md", ".github/**", "misc/*.func", "ct/create_lxc.sh", "api/**"],
|
||||||
|
"excludeGlobs": []
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"core": [
|
||||||
|
{
|
||||||
|
"fileStatus": null,
|
||||||
|
"includeGlobs": ["misc/*.func", "ct/create_lxc.sh"],
|
||||||
"excludeGlobs": []
|
"excludeGlobs": []
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -47,25 +42,35 @@
|
|||||||
"excludeGlobs": []
|
"excludeGlobs": []
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"maintenance": [
|
"api": [
|
||||||
{
|
|
||||||
"fileStatus": null,
|
|
||||||
"includeGlobs": ["*.md", ".github/**", "misc/*.func", "ct/create_lxc.sh"],
|
|
||||||
"excludeGlobs": ["misc/api.func"]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"api": [
|
|
||||||
{
|
{
|
||||||
"fileStatus": null,
|
"fileStatus": null,
|
||||||
"includeGlobs": ["api/**", "misc/api.func"],
|
"includeGlobs": ["api/**", "misc/api.func"],
|
||||||
"excludeGlobs": []
|
"excludeGlobs": []
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"github": [
|
||||||
|
{
|
||||||
|
"fileStatus": null,
|
||||||
|
"includeGlobs": [".github/**"],
|
||||||
|
"excludeGlobs": []
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"json": [
|
||||||
|
{
|
||||||
|
"fileStatus": "modified",
|
||||||
|
"includeGlobs": ["json/**"],
|
||||||
|
"excludeGlobs": []
|
||||||
|
}
|
||||||
|
],
|
||||||
|
|
||||||
"high risk": [
|
"high risk": [
|
||||||
{
|
{
|
||||||
"fileStatus": null,
|
"fileStatus": null,
|
||||||
"includeGlobs": ["misc/build.func", "misc/install.func", "ct/create_lxc.sh"],
|
"includeGlobs": ["misc/build.func", "misc/install.func", "ct/create_lxc.sh"],
|
||||||
"excludeGlobs": []
|
"excludeGlobs": []
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
|
||||||
|
|
||||||
|
}
|
90
.github/changelog-pr-config.json
vendored
90
.github/changelog-pr-config.json
vendored
@ -1,16 +1,8 @@
|
|||||||
[
|
[
|
||||||
{
|
|
||||||
"title": "💥 Breaking Changes",
|
|
||||||
"labels": ["breaking change"]
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"title": "🆕 New Scripts",
|
"title": "🆕 New Scripts",
|
||||||
"labels": ["new script"]
|
"labels": ["new script"]
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"title": "✨ New Features",
|
|
||||||
"labels": ["feature"]
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"title": "🚀 Updated Scripts",
|
"title": "🚀 Updated Scripts",
|
||||||
"labels": ["update script"],
|
"labels": ["update script"],
|
||||||
@ -21,27 +13,85 @@
|
|||||||
"notes" : []
|
"notes" : []
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"title": "General Updates",
|
"title": "✨ New Features",
|
||||||
"labels": ["general"],
|
"labels": ["feature"],
|
||||||
|
"notes" : []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "💥 Breaking Changes",
|
||||||
|
"labels": ["breaking change"],
|
||||||
"notes" : []
|
"notes" : []
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
|
||||||
"title": "🌐 Website",
|
|
||||||
"labels": ["website"]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"title": "📡 API",
|
|
||||||
"labels": ["api"]
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"title": "🧰 Maintenance",
|
"title": "🧰 Maintenance",
|
||||||
"labels": ["maintenance"]
|
"labels": ["maintenance"],
|
||||||
|
"subCategories": [
|
||||||
|
{
|
||||||
|
"title": "🐞 Bug Fixes",
|
||||||
|
"labels": ["bugfix"],
|
||||||
|
"notes" : []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "✨ New Features",
|
||||||
|
"labels": ["feature"],
|
||||||
|
"notes" : []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "💥 Breaking Changes",
|
||||||
|
"labels": ["breaking change"],
|
||||||
|
"notes" : []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "📡 API",
|
||||||
|
"labels": ["api"],
|
||||||
|
"notes" : []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "💾 Core",
|
||||||
|
"labels": ["core"],
|
||||||
|
"notes" : []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "📂 Github",
|
||||||
|
"labels": ["github"],
|
||||||
|
"notes" : []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "🌐 Website",
|
||||||
|
"labels": ["website"],
|
||||||
|
"subCategories": [
|
||||||
|
{
|
||||||
|
"title": "🐞 Bug Fixes",
|
||||||
|
"labels": ["bugfix"],
|
||||||
|
"notes" : []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "✨ New Features",
|
||||||
|
"labels": ["feature"],
|
||||||
|
"notes" : []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "💥 Breaking Changes",
|
||||||
|
"labels": ["breaking change"],
|
||||||
|
"notes" : []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "📝 Script Information",
|
||||||
|
"labels": ["json"],
|
||||||
|
"notes" : []
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"title": "❔ Unlabelled",
|
"title": "❔ Unlabelled",
|
||||||
"labels": []
|
"labels": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "💥 Breaking Changes",
|
||||||
|
"labels": ["breaking change"]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
18
.github/pull_request_template.md
vendored
18
.github/pull_request_template.md
vendored
@ -1,25 +1,25 @@
|
|||||||
## ✍️ Description
|
## ✍️ Description
|
||||||
<!-- Provide a clear and concise description of your changes. -->
|
<!-- Provide a clear and concise description of your changes. -->
|
||||||
|
|
||||||
|
|
||||||
## 🔗 Related PR / Discussion / Issue
|
## 🔗 Related PR / Discussion / Issue
|
||||||
|
|
||||||
Link: #
|
Link: #
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## ✅ Prerequisites
|
## ✅ Prerequisites
|
||||||
|
|
||||||
Before this PR can be reviewed, the following must be completed:
|
Before this PR can be reviewed, the following must be completed:
|
||||||
|
|
||||||
- [] **Self-review performed** – Code follows established patterns and conventions.
|
- [] **Self-review performed** – Code follows established patterns and conventions.
|
||||||
- [] **Testing performed** – Changes have been thoroughly tested and verified.
|
- [] **Testing performed** – Changes have been thoroughly tested and verified.
|
||||||
|
|
||||||
|
|
||||||
## 🛠️ Type of Change
|
## 🛠️ Type of Change
|
||||||
Select all that apply:
|
|
||||||
- [] 🐞 **Bug fix** – Resolves an issue without breaking functionality.
|
|
||||||
- [] ✨ **New feature** – Adds new, non-breaking functionality.
|
|
||||||
- [] 💥 **Breaking change** – Alters existing functionality in a way that may require updates.
|
|
||||||
- [] 🆕 **New script** – A fully functional and tested script or script set.
|
|
||||||
|
|
||||||
|
Select all that apply:
|
||||||
|
|
||||||
|
- [] 🆕 **New script** – A fully functional and tested script or script set.
|
||||||
|
- [] 🐞 **Bug fix** – Resolves an issue without breaking functionality.
|
||||||
|
- [] ✨ **New feature** – Adds new, non-breaking functionality.
|
||||||
|
- [] 💥 **Breaking change** – Alters existing functionality in a way that may require updates.
|
||||||
|
|
||||||
## 📋 Additional Information (optional)
|
## 📋 Additional Information (optional)
|
||||||
<!-- Provide extra context, screenshots, or references if needed. -->
|
<!-- Provide extra context, screenshots, or references if needed. -->
|
||||||
|
39
.github/workflows/autolabeler.yml
vendored
39
.github/workflows/autolabeler.yml
vendored
@ -11,7 +11,7 @@ jobs:
|
|||||||
permissions:
|
permissions:
|
||||||
pull-requests: write
|
pull-requests: write
|
||||||
env:
|
env:
|
||||||
CONFIG_PATH: .github/autolabeler-config.json
|
CONFIG_PATH: .github/autolabeler-config_new.json
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@ -43,26 +43,8 @@ jobs:
|
|||||||
});
|
});
|
||||||
const prFiles = prListFilesResponse.data;
|
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
|
// Apply labels based on file changes
|
||||||
for (const [label, rules] of Object.entries(autolabelerConfig)) {
|
for (const [label, rules] of Object.entries(autolabelerConfig)) {
|
||||||
const shouldAddLabel = prFiles.some((prFile) => {
|
const shouldAddLabel = prFiles.some((prFile) => {
|
||||||
@ -79,6 +61,21 @@ jobs:
|
|||||||
labelsToAdd.add(label);
|
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(", ")}`);
|
console.log(`Labels to add: ${Array.from(labelsToAdd).join(", ")}`);
|
||||||
|
|
||||||
@ -90,4 +87,4 @@ jobs:
|
|||||||
issue_number: prNumber,
|
issue_number: prNumber,
|
||||||
labels: Array.from(labelsToAdd),
|
labels: Array.from(labelsToAdd),
|
||||||
});
|
});
|
||||||
}
|
}
|
41
.github/workflows/changelog-pr.yml
vendored
41
.github/workflows/changelog-pr.yml
vendored
@ -58,10 +58,26 @@ jobs:
|
|||||||
const categorizedPRs = changelogConfig.map(obj => ({
|
const categorizedPRs = changelogConfig.map(obj => ({
|
||||||
...obj,
|
...obj,
|
||||||
notes: [],
|
notes: [],
|
||||||
subCategories: obj.subCategories ?? (obj.labels.includes("update script") ? [
|
subCategories: obj.subCategories ?? (
|
||||||
{ title: "🐞 Bug Fixes", labels: ["bugfix"] },
|
obj.labels.includes("update script") ? [
|
||||||
{ title: "✨ Feature Updates", labels: ["feature"] }
|
{ title: "🐞 Bug Fixes", labels: ["bugfix"], notes: [] },
|
||||||
] : [])
|
{ title: "✨ New Features", labels: ["feature"], notes: [] },
|
||||||
|
{ title: "💥 Breaking Changes", labels: ["breaking change"], notes: [] }
|
||||||
|
] :
|
||||||
|
obj.labels.includes("maintenance") ? [
|
||||||
|
{ title: "🐞 Bug Fixes", labels: ["bugfix"], notes: [] },
|
||||||
|
{ title: "✨ New Features", labels: ["feature"], notes: [] },
|
||||||
|
{ title: "💥 Breaking Changes", labels: ["breaking change"], notes: [] },
|
||||||
|
{ title: "📡 API", labels: ["api"], notes: [] },
|
||||||
|
{ title: "Github", labels: ["github"], notes: [] }
|
||||||
|
] :
|
||||||
|
obj.labels.includes("website") ? [
|
||||||
|
{ title: "🐞 Bug Fixes", labels: ["bugfix"], notes: [] },
|
||||||
|
{ title: "✨ New Features", labels: ["feature"], notes: [] },
|
||||||
|
{ title: "💥 Breaking Changes", labels: ["breaking change"], notes: [] },
|
||||||
|
{ title: "Script Information", labels: ["json"], notes: [] }
|
||||||
|
] : []
|
||||||
|
)
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const latestDateInChangelog = new Date(process.env.LATEST_DATE);
|
const latestDateInChangelog = new Date(process.env.LATEST_DATE);
|
||||||
@ -110,6 +126,7 @@ jobs:
|
|||||||
|
|
||||||
return categorizedPRs;
|
return categorizedPRs;
|
||||||
|
|
||||||
|
|
||||||
- name: Update CHANGELOG.md
|
- name: Update CHANGELOG.md
|
||||||
uses: actions/github-script@v7
|
uses: actions/github-script@v7
|
||||||
with:
|
with:
|
||||||
@ -124,7 +141,8 @@ jobs:
|
|||||||
|
|
||||||
console.log(JSON.stringify(categorizedPRs, null, 2));
|
console.log(JSON.stringify(categorizedPRs, null, 2));
|
||||||
|
|
||||||
let newReleaseNotes = `## ${today}\n\n### Changes\n\n`;
|
|
||||||
|
let newReleaseNotes = `## ${today}\n\n`;
|
||||||
for (const { title, notes, subCategories } of categorizedPRs) {
|
for (const { title, notes, subCategories } of categorizedPRs) {
|
||||||
const hasSubcategories = subCategories && subCategories.length > 0;
|
const hasSubcategories = subCategories && subCategories.length > 0;
|
||||||
const hasMainNotes = notes.length > 0;
|
const hasMainNotes = notes.length > 0;
|
||||||
@ -133,17 +151,16 @@ jobs:
|
|||||||
|
|
||||||
if (hasMainNotes || hasSubNotes) {
|
if (hasMainNotes || hasSubNotes) {
|
||||||
newReleaseNotes += `### ${title}\n\n`;
|
newReleaseNotes += `### ${title}\n\n`;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hasMainNotes) {
|
if (hasMainNotes) {
|
||||||
newReleaseNotes += `${notes.join("\n")}\n\n`;
|
newReleaseNotes += ` ${notes.join("\n")}\n\n`;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hasSubcategories) {
|
if (hasSubcategories) {
|
||||||
for (const { title: subTitle, notes: subNotes } of subCategories) {
|
for (const { title: subTitle, notes: subNotes } of subCategories) {
|
||||||
if (subNotes && subNotes.length > 0) {
|
if (subNotes && subNotes.length > 0) {
|
||||||
newReleaseNotes += ` #### ${subTitle}\n\n`;
|
newReleaseNotes += ` - #### ${subTitle}\n\n`;
|
||||||
newReleaseNotes += ` ${subNotes.join("\n ")}\n\n`;
|
newReleaseNotes += ` ${subNotes.join("\n ")}\n\n`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -206,4 +223,4 @@ jobs:
|
|||||||
PR_NUMBER=$(gh pr list --head "${BRANCH_NAME}" --json number --jq '.[].number')
|
PR_NUMBER=$(gh pr list --head "${BRANCH_NAME}" --json number --jq '.[].number')
|
||||||
if [ -n "$PR_NUMBER" ]; then
|
if [ -n "$PR_NUMBER" ]; then
|
||||||
gh pr review $PR_NUMBER --approve
|
gh pr review $PR_NUMBER --approve
|
||||||
fi
|
fi
|
Loading…
x
Reference in New Issue
Block a user