Skip to content

Commit df91056

Browse files
Add tracking labels to issue generation (#16)
This pull request exposes the `id` (e.g., `button-name`) and `scannerType` (e.g., `axe`) for each violation, making them available to label new issues. By adding these labels to issues, we can effectively track both issues and Copilot PRs, which will help us enhance our issue descriptions over time.
2 parents cdb5c22 + 2f8ebf0 commit df91056

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

.github/actions/file/src/openIssueForFinding.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ export async function openIssueForFinding(octokit: Octokit, repoWithOwner: strin
1616
state: 'open'
1717
});
1818
} else {
19+
20+
const labels = [`${finding.scannerType} rule: ${finding.ruleId}`, `${finding.scannerType}-scanning-issue`];
21+
1922
// Otherwise, create a new issue
2023
const title = `Accessibility issue: ${finding.problemShort[0].toUpperCase() + finding.problemShort.slice(1)} on ${new URL(finding.url).pathname}`;
2124
const solutionLong = finding.solutionLong
@@ -39,7 +42,8 @@ ${solutionLong ? `\nSpecifically:\n\n${solutionLong}` : ''}
3942
owner,
4043
repo,
4144
title,
42-
body
45+
body,
46+
labels
4347
});
4448
}
4549
}

.github/actions/file/src/types.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
export type Finding = {
2+
scannerType: string;
3+
ruleId: string;
24
url: string;
35
html: string;
46
problemShort: string;

.github/actions/find/src/findForUrl.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@ export async function findForUrl(url: string): Promise<Finding[]> {
1212
try {
1313
const rawFindings = await new AxeBuilder({ page }).analyze();
1414
findings = rawFindings.violations.map(violation => ({
15+
scannerType: 'axe',
1516
url,
1617
html: violation.nodes[0].html,
1718
problemShort: violation.help.toLowerCase(),
1819
problemUrl: violation.helpUrl,
20+
ruleId: violation.id,
1921
solutionShort: violation.description.toLowerCase(),
2022
solutionLong: violation.nodes[0].failureSummary
2123
}));

0 commit comments

Comments
 (0)