Skip to content

Commit bcb91b2

Browse files
committed
[JPC] Support cve-bf and cve-pre CVE reference formats
Allow commits to reference CVEs using 'cve-bf CVE-YYYY-NNNN' or 'cve-pre CVE-YYYY-NNNN' in addition to the standard 'cve CVE-YYYY-NNNN' format when validating against JIRA VULN tickets. Otherwise we will output a warning for these commits even though they are correctly referencing the CVE from the ticket.
1 parent f7dac5f commit bcb91b2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

jira_pr_check.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,11 +196,11 @@ def main():
196196
vuln_tickets.append(part.upper())
197197

198198
# Check for CVE line
199-
# Assume format: "cve CVE-YYYY-NNNN"
199+
# Assume format: "cve CVE-YYYY-NNNN", "cve-bf CVE-YYYY-NNNN", or "cve-pre CVE-YYYY-NNNN"
200200
# There will only be one CVE per line, but possibly multiple CVEs listed
201-
if stripped.lower().startswith('cve '):
201+
if stripped.lower().startswith(('cve ', 'cve-bf ', 'cve-pre ')):
202202
parts = stripped.split()
203-
for part in parts[1:]: # Skip 'cve' keyword/tag
203+
for part in parts[1:]: # Skip 'cve'/'cve-bf'/'cve-pre' keyword/tag
204204
# CVES always start with CVE-
205205
if part.upper().startswith('CVE-'):
206206
commit_cves.append(part.upper())

0 commit comments

Comments
 (0)