Adds links to screenshots when include_screenshots is true#137
Adds links to screenshots when include_screenshots is true#137lindseywild merged 32 commits intomainfrom
include_screenshots is true#137Conversation
| `; | ||
| const body = `## What | ||
|
|
||
| const body = `## What |
There was a problem hiding this comment.
Prettier / eslint cleanup -- I have it installed locally on VSCode so you may see some unrelated changes that are purely linting. Once we add eslint/Prettier in this repo it will be updated if it doesn't follow suit with the guidelines anyway.
There was a problem hiding this comment.
Pull request overview
This PR adds screenshot capture functionality to the accessibility scanner. When enabled (default), the scanner captures full-page screenshots during accessibility scans and stores them in a gh-cache branch, then includes links to these screenshots in the generated GitHub issues.
Changes:
- Added
include_screenshotsinput parameter (defaults to true) to control screenshot capture - Implemented screenshot capture in the find action using Playwright
- Enhanced gh-cache save/delete actions to handle directories in addition to files
- Updated issue body generation to include screenshot links when available
- Added
screenshot_repoparameter to support cross-repository screenshot references - Added comprehensive test coverage for screenshot-related functionality in the file action
Reviewed changes
Copilot reviewed 14 out of 16 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| action.yml | Added include_screenshots input, passed to find action, and added step to save screenshots to gh-cache |
| .github/actions/gh-cache/save/action.yml | Enhanced to handle both files and directories, with empty directory checking |
| .github/actions/gh-cache/delete/action.yml | Updated git commands for better directory handling |
| .github/actions/find/src/types.d.ts | Added optional screenshotId field to Finding type |
| .github/actions/find/src/index.ts | Added logic to read and pass include_screenshots parameter |
| .github/actions/find/src/findForUrl.ts | Implemented screenshot capture using Playwright with UUID-based filenames |
| .github/actions/find/action.yml | Added include_screenshots input parameter |
| .github/actions/file/tests/reopenIssue.test.ts | Added tests for screenshot repo parameter handling in reopenIssue |
| .github/actions/file/tests/openIssue.test.ts | Added tests for screenshot repo parameter handling in openIssue |
| .github/actions/file/tests/generateIssueBody.test.ts | Added tests for screenshot URL generation and omission |
| .github/actions/file/src/types.d.ts | Added optional screenshotId field to Finding type |
| .github/actions/file/src/reopenIssue.ts | Updated to generate and include issue body with screenshot links when reopening |
| .github/actions/file/src/openIssue.ts | Added screenshotRepo parameter for proper screenshot URL generation |
| .github/actions/file/src/index.ts | Added screenshot_repo input handling and passed to openIssue/reopenIssue |
| .github/actions/file/src/generateIssueBody.ts | Added screenshot section to issue body when screenshotId is present |
| .github/actions/file/action.yml | Added screenshot_repo input parameter |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
helen
left a comment
There was a problem hiding this comment.
Requesting that corresponding readme changes also be included in this before merge :)
|
I’m going to remove this from the FR queue. If FR support is required, please feel free to re-add it! |
abdulahmad307
left a comment
There was a problem hiding this comment.
No blocking concerns. Just a few minor readability and organizational thoughts.
| repository, | ||
| issue_number: issueNumber, | ||
| state: 'open', | ||
| ...body, |
There was a problem hiding this comment.
I swear I'm not trying to be annoying 🙏
one final nit: if we don't destructure this here, but assign it directly, the assignment on line 15 can become a 1-liner. body = generateIssueBody...
There was a problem hiding this comment.
Updated, thank you for calling out this silly thing!!
Adds links to screenshots (off by default).
This can be configured and turned on if
include_screenshotsis set totrue.GH Staff only - testing results