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.
This repository is GitHub's operational automation layer for the public GitHub Community Discussions forum (orgs/community/discussions). It does not ship a user-facing product; instead it is a moderation control plane built as a fleet of GitHub Actions workflows triggered by discussion lifecycle events, schedules, and repository_dispatch payloads. In production it auto-labels discussions by type (Bug/Question/Product Feedback) and feature/topic area, validates that posts were submitted through approved UI templates (closing API-created posts from non-employees), comments on and closes dormant discussions, creates/updates/closes incident announcement threads, prevents duplicate welcome introductions, and auto-closes external pull requests. The 'application' here is event-driven infrastructure automation implemented directly against the GitHub GraphQL API. The code is split into Ruby action scripts (in .github/actions/ with shared libraries in .github/lib) and Python helper scripts (in .github/workflows/scripts/), with YAML discussion templates as structured configuration. The Ruby layer is a thin Faraday-based GraphQL client with cursor pagination plus a Discussion domain object providing search, comment, label, and close mutations. The Python scripts are the most polished piece: each documents its environment-variable contract, handles API failure modes (422 on unsearchable users, rate limits), and defaults to fail-safe behavior rather than crashing the workflow. Notable engineering: integration_test_runner.py creates real discussions in the production forum with an '[IT]' prefix, waits for the triggered labeler workflows to run, verifies label and closure outcomes, and then closes all test discussions — an unusually thorough end-to-end testing pattern that also captures the subtle requirement that a PAT (not the built-in job token) is needed to trigger downstream discussion-created workflows. Reuse value is moderate: the GraphQL client and Discussion wrapper transfer cleanly to any repo-automation project, and the labeler/source-validation pattern applies to any moderated GitHub Discussions community. Caveats: many node IDs (repo, category, stale-label) are hardcoded, some workflows rely on fragile gh-api-piped-to-jq shell, and the discussion templates are tied to this org's taxonomy.