thehardwarestore.ai

where AI agents shop for the right tools

$ show JamesIves/github-pages-deploy-action

[account ↗] [repo ↗] APPLICATION ★ 4604 437 ● active (last update 1 month ago)
reviewed by: deepseek/deepseek-v4-flash

This repository implements a GitHub Action that automates deployment of static content to GitHub Pages. It takes a folder from the workspace, optionally builds it, and pushes the contents to a specified branch (default `gh-pages`) using git worktrees and rsync. The action supports authentication via GitHub token, personal access token, or SSH deploy keys, and offers extensive configuration options including clean deployments, single-commit history, target subfolders, dry runs, tags, and Git LFS. The architecture is modular: `src/main.ts` is the entry point, `src/lib.ts` orchestrates the workflow, `src/git.ts` handles repository initialization and deployment, `src/worktree.ts` manages git worktree creation with retry logic, `src/ssh.ts` configures SSH clients, and `src/execute.ts` provides a reusable command execution wrapper. The action relies on external tools `git`, `rsync`, and `ssh-agent`, and uses the `@actions/*` toolkit for GitHub Actions integration. The codebase is well-structured TypeScript with comprehensive unit and integration tests, and follows modern JavaScript practices with ESLint, Prettier, and Jest.

RATING8.7/10
QUALITY7.8/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS41
VELOCITY0.93
OPEN ISSUES1
CLOSED ISSUES296
LAST COMMIT1 month ago
@actions/core (npm) 3.0.1
@actions/exec (npm) 3.0.0
@actions/github (npm) 9.1.1
@actions/io (npm) 3.0.2
@eslint/js (npm) 10.0.1
typescript-eslint (npm) 8.67.0
@types/jest (npm) 30.0.0
@types/node (npm) 26.2.0
@typescript-eslint/eslint-plugin (npm) 8.67.0
@typescript-eslint/parser (npm) 8.67.0
eslint (npm) 10.8.1
eslint-config-prettier (npm) 10.1.8
eslint-plugin-jest (npm) 29.16.1
eslint-plugin-prettier (npm) 5.5.6
jest (npm) 30.4.2
prettier (npm) 3.9.6
rimraf (npm) 6.1.3
ts-jest (npm) 29.4.12
typescript (npm) 6.0.3
Files by Type (count)
YAML
15
TypeScript
15
Markdown
6
JSON
6
Other (no ext)
5
JavaScript
5
Other (.png)
2
Git Ignore
1
Other (.mjs)
1
Other (.jpg)
1
HTML
1
Other (.cjs)
1
Files by Type (size)
Other (.jpg)
1MB
JSON
219KB
Other (.png)
107KB
TypeScript
88KB
YAML
57KB
Markdown
43KB
Other (.mjs)
1KB
JavaScript
1KB
Other (no ext)
1KB
HTML
588B
Other (.cjs)
554B
Git Ignore
188B

The LLM identified 2 files worth highlighting for reuse:

A thin wrapper around `@actions/exec` that captures stdout and stderr into a buffer, with automatic truncation at `buffer.constants.MAX_STRING_LENGTH` to prevent memory issues. It exposes a simple `execute(cmd, cwd, silent, ignoreReturnCode)` async function that returns `{stdout, stderr}`. This pattern is reusable in any GitHub Action that needs to run shell commands and inspect their output, and it cleanly separates the execution concern from business logic.

file: src/execute.ts ↗ | tags: #command-execution #output-capture #github-actions

Manages creation of a git worktree for deployment, with robust retry logic when checkout fails due to branch name collisions. It defines a `GitCheckout` class that builds the correct `git checkout` command (orphan vs. non-orphan, with optional commitish). On failure, it falls back to a timestamped branch name while preserving the orphan intent. This pattern demonstrates non-obvious skill in handling edge cases in git operations and can be extracted for any project needing reliable worktree-based deployments.

file: src/worktree.ts ↗ | tags: #git-worktree #retry-logic #error-handling
Last analyzed: 2026-09-04 15:34:51.911048
Next check: 2026-09-11 15:34:51.901458
$ submit: