Skip to content

fix: limit SARIF rule tags to 10 for GitHub Code Scanning AB#2142#53

Merged
emmanuelknafo merged 1 commit intomainfrom
feature/2142-limit-sarif-rule-tags
Mar 30, 2026
Merged

fix: limit SARIF rule tags to 10 for GitHub Code Scanning AB#2142#53
emmanuelknafo merged 1 commit intomainfrom
feature/2142-limit-sarif-rule-tags

Conversation

@emmanuelknafo
Copy link
Copy Markdown
Contributor

@emmanuelknafo emmanuelknafo commented Mar 30, 2026

Summary

GitHub Code Scanning warns that rules image-alt and select-name exceed the 10-tag limit in uploaded SARIF files. axe-core attaches many tags to rules (WCAG criteria, categories, best-practice markers), which can exceed GitHub's limit.

Changes

  • sarif-generator.ts — add truncateTags(tags, limit) helper that prioritizes WCAG tags (/^wcag\d/) then takes the first 10
  • Apply to properties.tags when building SARIF rules

All 28 existing SARIF tests pass.

Fixes AB#2142

- add truncateTags helper that prioritizes WCAG tags
- apply to rule properties.tags in SARIF generator

🔧 - Generated by Copilot
@github-actions
Copy link
Copy Markdown

Coverage Report for Coverage

Status Category Percentage Covered / Total
🔵 Lines 83.02% (🎯 80%) 724 / 872
🔵 Statements 82.42% (🎯 80%) 788 / 956
🔵 Functions 80% (🎯 80%) 132 / 165
🔵 Branches 70.01% (🎯 65%) 369 / 527
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/lib/report/sarif-generator.ts 88% 74.28% 87.5% 89.85% 88, 102, 135, 158, 179-181
Generated in workflow #139 for commit eb27b00 by the Vitest Coverage Report Action

@emmanuelknafo emmanuelknafo merged commit eab9625 into main Mar 30, 2026
14 of 18 checks passed
@emmanuelknafo emmanuelknafo deleted the feature/2142-limit-sarif-rule-tags branch March 30, 2026 01:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant