Release Readiness Action
GitHub Marketplace Action and CLI enforcing automated pre-release checks for secrets, documentation completeness, package entry points, lockfiles, git tags, and checklists.
01. Problem & Context
Teams frequently tag releases or merge deployment PRs with leaked API keys, placeholder `TODO` documentation, broken `dist/` package entry points, conflicting package-manager lockfiles, or unchecked release checklist items.
02. Engineering Solution
Created and published `release-readiness-action` (`adamblansett/release-readiness-action@v1`) on GitHub Marketplace alongside the `@adamblansett/release-readiness-action` (`release-readiness`) CLI. Configured via `.release-readiness.yml`/`.json` or Action inputs, it evaluates 8 release-gate categories locally with zero default network or script execution, outputs PR diff annotations and GitHub Step Summaries, and prevents symlink escapes.
03. System Architecture
A single TypeScript engine compiled via `ncc` for GitHub Actions runners and `dist/cli.js` for local developers collects canonical-path-contained workspace files, runs 8 modular release-readiness evaluators, masks any detected secrets, and writes JSON, GFM Markdown, Step Summaries, and inline GitHub PR annotations.
Core Architectural Components
Project Structure, Documentation & Checklist Gates
Verifies required files, licenses, security policies, CI workflows, minimum doc sizes, unresolved placeholders (`TODO`, `FIXME`, `LOREM IPSUM`), and completed `- [x]` tasks in `RELEASE_CHECKLIST.md`.
Package Metadata, Entry Points & Dependency Hygiene
Validates semver formatting, license fields, and existence on disk of built `main`/`module`/`types`/`bin`/`exports` targets while detecting missing or conflicting multi-manager lockfiles and optional opt-in `npm audit`.
100% Local Secret Scanner & Canonical Path Containment
Scans bounded files (default 512 KB cap) locally without network calls for AWS, GitHub, Slack, Stripe, OpenAI, private keys, and DB credentials—always printing redacted snippets (`AKIA****...****PLE`) and blocking symlink traversal.
Git Hygiene & Safe Arg-Array Script Runner
Checks clean working trees, allowed release branches, and git tag-to-package version parity (`check-tag-version`), while executing opt-in lifecycle scripts (`execute-scripts: true`) strictly via argument arrays with 1 MB output caps and timeouts.
04. Notable Engineering Decisions
Secure-by-Default Zero Script & Zero Network Execution
Running arbitrary `package.json` scripts or network audits unexpectedly on untrusted PRs creates CI supply-chain risks; both `execute-scripts` and `audit-dependencies` are disabled by default until explicitly enabled.
Argument-Array Subprocesses & Canonical Symlink Containment
Invoking commands via argument arrays (`['npm', 'run', 'build']`) eliminates shell injection, while resolving canonical real paths prevents symlinks from reading host runner files outside the workspace.
Dual GitHub Action + Local Pre-Push CLI
Developers can run `npx @adamblansett/release-readiness-action` (or `node dist/cli.js`) locally before pushing tags, using the exact same `.release-readiness.yml` rules enforced in GitHub Actions.
05. Engineering Challenges & Solutions
Challenge: Preventing published npm/GitHub Packages bundles from shipping broken `main`/`types`/`bin` paths after refactors.
Engineering Solution: Added `validateEntryPoints` and `validateFilesWhitelist` checks that verify every declared `package.json` artifact exists on disk post-build.
Challenge: Surfacing actionable PR feedback without exposing detected credentials in GitHub workflow logs or annotations.
Engineering Solution: Redacted every secret match prior to formatting JSON, Markdown, PR annotations, and Step Summary outputs.
06. Implementation Highlights
- Published GitHub Marketplace Action (`adamblansett/release-readiness-action@v1`) bundled with `ncc` plus GitHub Packages CLI (`@adamblansett/release-readiness-action`)
- 8 release gates: repository structure, docs & placeholder checks, package entry-point validation, local secret scanning, opt-in script checks, lockfile hygiene, git tag alignment, and `RELEASE_CHECKLIST.md`
- 100% local secret scanning with redacted outputs (`AKIA****...****PLE`) and canonical-path symlink containment
- Safe argument-array subprocess execution with 1 MB output bounds and timeouts when explicitly opted in
- Outputs `passed`, `findings-count`, `errors-count`, `warnings-count`, `report-json`, `report-markdown`, Step Summaries, and inline PR annotations
- Verified across 17 Vitest test files (74 passing tests) and Node 20.x/22.x CI