Skip to content

Commit 7af6a94

Browse files
committed
fix(ci): exclude sub-IDs from ID uniqueness check
The regex now uses negative lookahead to avoid matching sub-IDs (e.g., REQ-KERNEL-001.1) as duplicates of their parent ID.
1 parent 9d9e0c1 commit 7af6a94

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

.github/workflows/openspec-validation.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,10 @@ jobs:
7272
7373
- name: Validate ID uniqueness
7474
run: |
75-
req_dups=$(grep -rh "REQ-" openspec/specs/ 2>/dev/null | grep -oE "REQ-[A-Z]+-[0-9]+" | sort | uniq -d)
76-
dec_dups=$(grep -rh "DEC-" openspec/specs/ 2>/dev/null | grep -oE "DEC-[A-Z]+-[0-9]+" | sort | uniq -d)
77-
con_dups=$(grep -rh "CON-" openspec/specs/ 2>/dev/null | grep -oE "CON-[A-Z]+-[0-9]+" | sort | uniq -d)
75+
# Match complete IDs only, exclude sub-IDs like REQ-KERNEL-001.1
76+
req_dups=$(grep -rh "REQ-" openspec/specs/ 2>/dev/null | grep -oE "REQ-[A-Z]+-[0-9]+(?!\.[0-9])" | sort | uniq -d)
77+
dec_dups=$(grep -rh "DEC-" openspec/specs/ 2>/dev/null | grep -oE "DEC-[A-Z]+-[0-9]+(?!\.[0-9])" | sort | uniq -d)
78+
con_dups=$(grep -rh "CON-" openspec/specs/ 2>/dev/null | grep -oE "CON-[A-Z]+-[0-9]+(?!\.[0-9])" | sort | uniq -d)
7879
7980
test -z "$req_dups" || (echo "::error::Duplicate REQ IDs found: $req_dups" && exit 1)
8081
test -z "$dec_dups" || (echo "::error::Duplicate DEC IDs found: $dec_dups" && exit 1)

0 commit comments

Comments
 (0)