$ show swinton/screenshot-website
This repository is a GitHub Action designed to capture screenshots of websites across different operating systems. It takes inputs such as source URL or HTML content, destination filename, and optional parameters like full-page capture, width, and delay. The action uses the `capture-website` package (which relies on Puppeteer) to generate the screenshot, then uploads it as an artifact in the GitHub Actions workflow and exposes the file path as an output. The architecture is straightforward: the entry point (index.js) delegates to core logic in lib/screenshot-website.js, which handles input processing, Chrome executable location based on the runner OS, screenshot capture, artifact upload, and output setting. While the main logic is tightly coupled to the GitHub Actions environment, the repository contains a reusable utility function for normalizing and parsing action inputs (lib/load-inputs.js) that could be extracted for use in other Node.js projects. The action shows signs of technical drift due to its reliance on Node.js 12 (end-of-life) and outdated dependencies like Puppeteer 13.7.0, though it remains functional through active Dependabot updates and CI workflows.
The LLM identified 1 files worth highlighting for reuse:
This function normalizes GitHub Action input names (converting kebab-case to camelCase) and parses input values using YAML to handle booleans, numbers, etc. It is a self-contained utility with zero external dependencies beyond js-yaml, making it easily extractable to any Node.js project processing GitHub Action inputs. It demonstrates non-obvious skill in safely handling input transformation and type conversion without framework coupling.