1
0
mirror of https://github.com/community-scripts/ProxmoxVE.git synced 2025-04-20 05:08:06 +00:00
This commit is contained in:
Michel Roegl-Brunner 2025-03-24 14:18:00 +01:00 committed by GitHub
parent 92dd4bcae2
commit 247b7477c9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -89,7 +89,7 @@ jobs:
const { data: pulls } = await github.rest.pulls.list({ const { data: pulls } = await github.rest.pulls.list({
owner: context.repo.owner, owner: context.repo.owner,
repo: context.repo.repo, repo: "ProxmoxVE",
base: "main", base: "main",
state: "closed", state: "closed",
sort: "updated", sort: "updated",
@ -110,9 +110,9 @@ jobs:
let prNote = `- ${pr.title} [@${pr.user.login}](https://github.com/${pr.user.login}) ([#${pr.number}](${pr.html_url}))`; let prNote = `- ${pr.title} [@${pr.user.login}](https://github.com/${pr.user.login}) ([#${pr.number}](${pr.html_url}))`;
if (pr.user.login === "push-app-to-main") {
if (pr.user.login.includes("push-app-to-main[bot]")) {
const scriptName = pr.title; const scriptName = pr.title;
if (scriptName) {
try { try {
const { data: relatedIssues } = await github.rest.issues.listForRepo({ const { data: relatedIssues } = await github.rest.issues.listForRepo({
owner: context.repo.owner, owner: context.repo.owner,
@ -131,31 +131,43 @@ jobs:
} }
} catch (error) { } catch (error) {
console.error(`Error fetching related issues: ${error}`); console.error(`Error fetching related issues: ${error}`);
prNote = `- ${pr.title} ([#${pr.number}](${pr.html_url}))`;
} }
} else {
prNote = `- ${pr.title} ([#${pr.number}](${pr.html_url}))`;
}
} }
// Find matching category
for (const category of categorizedPRs) {
if (category.labels.some(label => prLabels.includes(label))) {
// Check if PR belongs to a subcategory
if (category.subCategories && category.subCategories.length > 0) {
const subCategory = category.subCategories.find(sub =>
sub.labels.some(label => prLabels.includes(label))
);
if (subCategory) {
subCategory.notes.push(prNote); if (prLabels.includes("new script")) {
} else { const newScriptCategory = categorizedPRs.find(category =>
category.notes.push(prNote); category.title === "New Scripts" || category.labels.includes("new script"));
} if (newScriptCategory) {
newScriptCategory.notes.push(prNote);
}
} else {
let categorized = false;
const priorityCategories = categorizedPRs.slice();
for (const category of priorityCategories) {
if (categorized) break;
if (category.labels.some(label => prLabels.includes(label))) {
if (category.subCategories && category.subCategories.length > 0) {
const subCategory = category.subCategories.find(sub =>
sub.labels.some(label => prLabels.includes(label))
);
if (subCategory) {
subCategory.notes.push(prNote);
} else { } else {
category.notes.push(prNote); category.notes.push(prNote);
} }
} else {
category.notes.push(prNote);
}
categorized = true;
}
} }
} }
} }
return categorizedPRs; return categorizedPRs;