Skip to content

Commit be2eacd

Browse files
authored
feat(vulnerability): improve GitHub advisory PR body notes with summary, GHSA ID and references (#42670)
feat(vulnerability): improve GitHub advisory PR body notes with summary and GHSA ID
1 parent 171d177 commit be2eacd

5 files changed

Lines changed: 342 additions & 55 deletions

File tree

lib/modules/platform/github/index.spec.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4759,6 +4759,8 @@ describe('modules/platform/github/index', () => {
47594759
.reply(200, [
47604760
{
47614761
security_advisory: {
4762+
ghsa_id: 'GHSA-1234-5678-9012',
4763+
summary: 'summary',
47624764
description: 'description',
47634765
identifiers: [{ type: 'type', value: 'value' }],
47644766
references: [],
@@ -4779,6 +4781,8 @@ describe('modules/platform/github/index', () => {
47794781
},
47804782
{
47814783
security_advisory: {
4784+
ghsa_id: 'GHSA-1234-5678-9012',
4785+
summary: 'summary',
47824786
description: 'description',
47834787
identifiers: [{ type: 'type', value: 'value' }],
47844788
references: [],
@@ -4833,6 +4837,8 @@ describe('modules/platform/github/index', () => {
48334837
.reply(200, [
48344838
{
48354839
security_advisory: {
4840+
ghsa_id: 'GHSA-1234-5678-9012',
4841+
summary: 'summary',
48364842
description: 'description',
48374843
identifiers: [{ type: 'type', value: 'value' }],
48384844
references: [],
@@ -4854,6 +4860,8 @@ describe('modules/platform/github/index', () => {
48544860

48554861
{
48564862
security_advisory: {
4863+
ghsa_id: 'GHSA-1234-5678-9012',
4864+
summary: 'summary',
48574865
description: 'description',
48584866
identifiers: [{ type: 'type', value: 'value' }],
48594867
references: [],
@@ -4885,6 +4893,8 @@ describe('modules/platform/github/index', () => {
48854893
.reply(200, [
48864894
{
48874895
security_advisory: {
4896+
ghsa_id: 'GHSA-1234-5678-9012',
4897+
summary: 'summary',
48884898
description: 'description',
48894899
identifiers: [{ type: 'type', value: 'value' }],
48904900
references: [],
@@ -4922,6 +4932,8 @@ describe('modules/platform/github/index', () => {
49224932
[
49234933
{
49244934
security_advisory: {
4935+
ghsa_id: 'GHSA-1234-5678-9012',
4936+
summary: 'summary',
49254937
description: 'description',
49264938
identifiers: [{ type: 'type', value: 'value' }],
49274939
references: [],
@@ -4942,6 +4954,8 @@ describe('modules/platform/github/index', () => {
49424954
},
49434955
{
49444956
security_advisory: {
4957+
ghsa_id: 'GHSA-1234-5678-9012',
4958+
summary: 'summary',
49454959
description: 'description',
49464960
identifiers: [{ type: 'type', value: 'value' }],
49474961
references: [],
@@ -4971,6 +4985,8 @@ describe('modules/platform/github/index', () => {
49714985
.reply(200, [
49724986
{
49734987
security_advisory: {
4988+
ghsa_id: 'GHSA-1234-5678-9012',
4989+
summary: 'summary',
49744990
description: 'description',
49754991
identifiers: [{ type: 'type', value: 'value' }],
49764992
references: [],

lib/modules/platform/github/schema.spec.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ describe('modules/platform/github/schema', () => {
113113
{
114114
dismissed_reason: null,
115115
security_advisory: {
116+
ghsa_id: 'GHSA-1111-2222-3333',
117+
summary: 'Test advisory',
116118
description: 'Test advisory',
117119
identifiers: [{ type: 'CVE', value: 'CVE-2024-1234' }],
118120
severity: 'high',
@@ -128,6 +130,8 @@ describe('modules/platform/github/schema', () => {
128130
{
129131
dismissed_reason: null,
130132
security_advisory: {
133+
ghsa_id: 'GHSA-4444-5555-6666',
134+
summary: 'Test advisory',
131135
description: 'Test advisory',
132136
identifiers: [{ type: 'CVE', value: 'CVE-2024-5678' }],
133137
severity: 'medium',
@@ -150,6 +154,8 @@ describe('modules/platform/github/schema', () => {
150154
{
151155
dismissed_reason: null,
152156
security_advisory: {
157+
ghsa_id: 'GHSA-1111-2222-3333',
158+
summary: 'Test advisory',
153159
description: 'Test advisory',
154160
identifiers: [{ type: 'CVE', value: 'CVE-2024-1234' }],
155161
severity: 'high',
@@ -177,6 +183,8 @@ describe('modules/platform/github/schema', () => {
177183
{
178184
dismissed_reason: null,
179185
security_advisory: {
186+
ghsa_id: 'GHSA-4444-5555-6666',
187+
summary: 'Test advisory',
180188
description: 'Test advisory',
181189
identifiers: [{ type: 'CVE', value: 'CVE-2024-5678' }],
182190
severity: 'high',
@@ -200,6 +208,8 @@ describe('modules/platform/github/schema', () => {
200208
{
201209
dismissed_reason: null,
202210
security_advisory: {
211+
ghsa_id: 'GHSA-1111-2222-3333',
212+
summary: 'Test advisory',
203213
description: 'Test advisory',
204214
identifiers: [{ type: 'CVE', value: 'CVE-2024-1234' }],
205215
severity: 'high',

lib/modules/platform/github/schema.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ const CvssSeverity = z.object({
4343
});
4444

4545
const SecurityAdvisory = z.object({
46+
ghsa_id: z.string(),
47+
summary: z.string(),
4648
description: z.string(),
4749
identifiers: z.array(
4850
z.object({

0 commit comments

Comments
 (0)