Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 26 additions & 6 deletions Tasks/GitHubReleaseV1/operations/ChangeLog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,15 @@ export class ChangeLog {
let issuesListResponse = await release.getIssuesList(githubEndpointToken, repositoryName, issues, true);
if (issuesListResponse.statusCode === 200) {
if (!!issuesListResponse.body.errors) {
console.log(tl.loc("IssuesFetchError"));
tl.warning(JSON.stringify(issuesListResponse.body.errors));
return "";
// If issue was not found (or is a Discussion), raise a warning and continue with other issues.
if (issuesListResponse.body.errors.every(error => error.type === "NOT_FOUND")) {
tl.warning("Some issues were not found. They might be GitHub Discussions or the issue ID might be wrong. Please verify the issue IDs linked in the commits.");
}
else {
tl.error(tl.loc("IssuesFetchError"));
tl.warning(JSON.stringify(issuesListResponse.body.errors));
return "";
}
}
else {
let changeLog: string = "";
Expand Down Expand Up @@ -182,9 +188,15 @@ export class ChangeLog {
let issuesListResponse = await release.getIssuesList(githubEndpointToken, repositoryName, issues, false);
if (issuesListResponse.statusCode === 200) {
if (!!issuesListResponse.body.errors) {
console.log(tl.loc("IssuesFetchError"));
tl.warning(JSON.stringify(issuesListResponse.body.errors));
return "";
// If issue was not found (or is a Discussion), raise a warning and continue with other issues.
if (issuesListResponse.body.errors.every(error => error.type === "NOT_FOUND")) {
tl.warning("Some issues were not found. They might be GitHub Discussions or the issue ID might be wrong. Please verify the issue IDs linked in the commits.");
}
else {
console.log(tl.loc("IssuesFetchError"));
tl.warning(JSON.stringify(issuesListResponse.body.errors));
return "";
}
}
else {
let changeLog: string = "";
Expand All @@ -193,6 +205,10 @@ export class ChangeLog {
let issuesList = issuesListResponse.body.data.repository;
tl.debug("issuesListResponse: " + JSON.stringify(issuesList));
Object.keys(issuesList).forEach((key: string, index: number) => {
// Skip null entries (e.g. GitHub Discussions)
if (!issuesList[key]) {
return;
}
let changeLogPerIssue = this._getChangeLogPerIssue(key.substr(1), issuesList[key].title);
// See more functionality
if (index >= this._changeLogVisibleLimit) {
Expand Down Expand Up @@ -489,6 +505,10 @@ export class ChangeLog {
});
labelsIssuesDictionary[this._defaultGroup] = [];
Object.keys(issuesList).forEach((issue: string) => {
// Skip null entries (e.g. GitHub Discussions)
if (!issuesList[issue]) {
return;
}
let group: string = null;
let currentLabelRank: number = Number.MAX_SAFE_INTEGER;
let issueState = issuesList[issue].state;
Expand Down
2 changes: 1 addition & 1 deletion Tasks/GitHubReleaseV1/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"preview": false,
"version": {
"Major": 1,
"Minor": 270,
"Minor": 271,
"Patch": 0
},
"demands": [],
Expand Down