Skip to content

Commit

Permalink
Add reference link columns
Browse files Browse the repository at this point in the history
  • Loading branch information
ankush-jain-akto committed Jul 7, 2023
1 parent 107a99f commit 0f5dc55
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions .github/workflows/csvUpdate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,13 @@ jobs:
column.append(yaml_data['info']['impact'])
column.append(yaml_data['info']['category']['displayName'])
column.append(yaml_data['info']['severity'])
references = []

if 'references' in yaml_data['info']:
column.append(yaml_data['info']['references'])
references = yaml_data['info']['references']

else:
column.append("")

Expand All @@ -90,6 +94,15 @@ jobs:
url_path = ''
column.append(url_path)
column.append(yaml_data['id'])

rlink1 = "" if len(references) <= 0 else references[0]
rlink2 = "" if len(references) <= 1 else references[1]
rlink3 = "" if len(references) <= 2 else references[2]

column.append(rlink1)
column.append(rlink2)
column.append(rlink3)

csv_writer.writerow(column)


Expand All @@ -112,7 +125,7 @@ jobs:
if yaml_files:
with open(csv_file_path, 'w', newline='') as csv_file:
writer = csv.writer(csv_file)
writer.writerow(['Name', 'Slug', 'Description', 'Details', 'Impact', 'OWASP Category', 'Severity', 'References', 'Content', 'URL Path', 'Test_ID'])
writer.writerow(['Name', 'Slug', 'Description', 'Details', 'Impact', 'OWASP Category', 'Severity', 'References', 'Content', 'URL Path', 'Test_ID', 'RLink1', 'RLink2', 'RLink3'])

for yaml_file in yaml_files:
yaml_url = yaml_file['html_url']
Expand Down

0 comments on commit 0f5dc55

Please sign in to comment.