Skip to content

Commit b1f51e2

Browse files
Fix Workflow (#3387)
1 parent 7d0f60c commit b1f51e2

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

.github/workflows/changelog-pr.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -107,36 +107,38 @@ jobs:
107107
108108
for (const pr of filteredPRs) {
109109
const prLabels = pr.labels.map(label => label.name.toLowerCase());
110-
111-
let prNote = `- ${pr.title} [@${pr.user.login}](https://github.com/${pr.user.login}) ([#${pr.number}](${pr.html_url}))`;
112-
113-
114110
if (pr.user.login.includes("push-app-to-main[bot]")) {
111+
115112
const scriptName = pr.title;
116113
try {
117114
const { data: relatedIssues } = await github.rest.issues.listForRepo({
118115
owner: context.repo.owner,
119116
repo: "ProxmoxVED",
120117
state: "all",
121-
labels: ["Started Migration To ProxmoxVE"],
122-
per_page: 5
118+
labels: ["Started Migration To ProxmoxVE"]
123119
});
120+
124121
const matchingIssue = relatedIssues.find(issue =>
125122
issue.title.toLowerCase().includes(scriptName.toLowerCase())
126123
);
124+
127125
if (matchingIssue) {
128126
const issueAuthor = matchingIssue.user.login;
129127
const issueAuthorUrl = `https://github.com/${issueAuthor}`;
130128
prNote = `- ${pr.title} [@${issueAuthor}](${issueAuthorUrl}) ([#${pr.number}](${pr.html_url}))`;
131129
}
130+
else {
131+
prNote = `- ${pr.title} ([#${pr.number}](${pr.html_url}))`;
132+
}
132133
} catch (error) {
133134
console.error(`Error fetching related issues: ${error}`);
134135
prNote = `- ${pr.title} ([#${pr.number}](${pr.html_url}))`;
135136
}
137+
}else{
138+
prNote = `- ${pr.title} [@${pr.user.login}](https://github.com/${pr.user.login}) ([#${pr.number}](${pr.html_url}))`;
136139
}
137140
138141
139-
140142
if (prLabels.includes("new script")) {
141143
const newScriptCategory = categorizedPRs.find(category =>
142144
category.title === "New Scripts" || category.labels.includes("new script"));
@@ -174,7 +176,7 @@ jobs:
174176
}
175177
176178
return await main();
177-
179+
178180
- name: Update CHANGELOG.md
179181
uses: actions/github-script@v7
180182
with:

0 commit comments

Comments
 (0)