Skip to content

Commit

Permalink
Merge pull request #38 from martincostello/Fix-CVE-List
Browse files Browse the repository at this point in the history
Fix empty CVE list header
  • Loading branch information
martincostello authored Mar 2, 2021
2 parents df25ab1 + e20f1bd commit c25755a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
10 changes: 6 additions & 4 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,12 @@ class DotNetSdkUpdater {
if (versions.current.security && versions.current.securityIssues.length > 0) {
issues = issues.filter(issue => versions.current.securityIssues.findIndex(other => other.id === issue.id) < 0);
}
body += `\n\nThis release includes fixes for the following security issue(s):`;
issues.forEach(issue => {
body += `\n * [${issue.id}](${issue.url})`;
});
if (issues.length > 0) {
body += `\n\nThis release includes fixes for the following security issue(s):`;
issues.forEach(issue => {
body += `\n * [${issue.id}](${issue.url})`;
});
}
}
// TODO Update to support GHE
body += `\n\nThis pull request was auto-generated by [GitHub Actions](https://github.com/${this.options.repo}/actions/runs/${this.options.runId}).`;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "update-dotnet-sdk",
"version": "1.1.1",
"version": "1.1.2",
"private": true,
"description": "A GitHub Action that updates the .NET SDK.",
"main": "lib/update-dotnet-sdk.js",
Expand Down
10 changes: 6 additions & 4 deletions src/DotNetSdkUpdater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,12 @@ export class DotNetSdkUpdater {
issues = issues.filter(issue => versions.current.securityIssues.findIndex(other => other.id === issue.id) < 0);
}

body += `\n\nThis release includes fixes for the following security issue(s):`;
issues.forEach(issue => {
body += `\n * [${issue.id}](${issue.url})`;
});
if (issues.length > 0) {
body += `\n\nThis release includes fixes for the following security issue(s):`;
issues.forEach(issue => {
body += `\n * [${issue.id}](${issue.url})`;
});
}
}

// TODO Update to support GHE
Expand Down

0 comments on commit c25755a

Please sign in to comment.