mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2025-04-28 22:03:08 +00:00
Update workflow (#3371)
This commit is contained in:
parent
e2e6ad5935
commit
39904741dd
32
.github/workflows/changelog-pr.yml
vendored
32
.github/workflows/changelog-pr.yml
vendored
@ -105,8 +105,37 @@ jobs:
|
|||||||
).forEach(pr => {
|
).forEach(pr => {
|
||||||
|
|
||||||
const prLabels = pr.labels.map(label => label.name.toLowerCase());
|
const prLabels = pr.labels.map(label => label.name.toLowerCase());
|
||||||
const 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") {
|
||||||
|
const scriptName = pr.title;
|
||||||
|
if (scriptName) {
|
||||||
|
try {
|
||||||
|
const { data: relatedIssues } = await github.rest.issues.listForRepo({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: "ProxmoxVED",
|
||||||
|
state: "all",
|
||||||
|
label: "Started Migration To ProxmoxVE",
|
||||||
|
per_page: 5
|
||||||
|
});
|
||||||
|
const matchingIssue = relatedIssues.find(issue =>
|
||||||
|
issue.title.toLowerCase().includes(scriptName.toLowerCase())
|
||||||
|
);
|
||||||
|
if (matchingIssue) {
|
||||||
|
const issueAuthor = matchingIssue.user.login;
|
||||||
|
const issueAuthorUrl = `https://github.com/${issueAuthor}`;
|
||||||
|
const prNote = `- ${pr.title} [@${issueAuthor}](${issueAuthorUrl}) ([#${pr.number}](${pr.html_url}))`;
|
||||||
|
} else {
|
||||||
|
const prNote = `- ${pr.title} ([#${pr.number}](${pr.html_url}))`;
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error(`Error fetching related issues: ${error}`);
|
||||||
|
const prNote = `- ${pr.title} ([#${pr.number}](${pr.html_url}))`;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
const prNote = `- ${pr.title} ([#${pr.number}](${pr.html_url}))`;
|
||||||
|
|
||||||
|
}else{
|
||||||
|
const prNote = `- ${pr.title} [@${pr.user.login}](https://github.com/${pr.user.login}) ([#${pr.number}](${pr.html_url}))`;
|
||||||
|
}
|
||||||
const updateScriptsCategory = categorizedPRs.find(category =>
|
const updateScriptsCategory = categorizedPRs.find(category =>
|
||||||
category.labels.some(label => prLabels.includes(label))
|
category.labels.some(label => prLabels.includes(label))
|
||||||
);
|
);
|
||||||
@ -152,6 +181,7 @@ jobs:
|
|||||||
const hasSubNotes = hasSubcategories && subCategories.some(sub => sub.notes && sub.notes.length > 0);
|
const hasSubNotes = hasSubcategories && subCategories.some(sub => sub.notes && sub.notes.length > 0);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (hasMainNotes || hasSubNotes) {
|
if (hasMainNotes || hasSubNotes) {
|
||||||
newReleaseNotes += `### ${title}\n\n`;
|
newReleaseNotes += `### ${title}\n\n`;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user