Shared GitHub Actions workflows for consistent code quality checks across repositories.
This repository provides reusable workflows for:
- Prettier Check - Validates code formatting with Prettier
- Markdown Lint - Lints Markdown files using rumdl
- Conventional Commit Check for PR Title - Validates PR titles follow conventional commit format
- PR Checks - Combined workflow that runs all checks (or selected ones) with draft PR handling
Use the combined pr-checks.yml workflow to run all checks at once. This
workflow automatically handles draft PRs and runs all checks by default.
Create .github/workflows/pr-checks.yml in your repository:
name: PR Checks
on:
pull_request:
types: [opened, reopened, synchronize, ready_for_review]
jobs:
checks:
uses: holdex/github-actions/.github/workflows/pr-checks.yml@mainTo run only specific checks, pass input flags:
name: PR Checks
on:
pull_request:
types: [opened, reopened, synchronize, ready_for_review]
jobs:
checks:
uses: holdex/github-actions/.github/workflows/pr-checks.yml@main
with:
run-prettier: true
run-markdown: false # Skip markdown check
run-commits: trueUse individual workflows for granular control over when each check runs.
name: Prettier Check
on:
pull_request:
types: [opened, reopened, synchronize]
jobs:
prettier:
uses: holdex/github-actions/.github/workflows/prettier.yml@mainRequirements:
- Prettier configuration file (
.prettierrc,.prettierrc.json, etc.) orprettierconfig inpackage.json
name: Markdown Lint
on:
pull_request:
types: [opened, reopened, synchronize]
jobs:
markdown:
uses: holdex/github-actions/.github/workflows/markdown-check.yml@mainname: Commit Check
on:
pull_request:
types: [opened, reopened, synchronize]
jobs:
commits:
uses: holdex/github-actions/.github/workflows/commit-check.yml@mainRequirements:
- Commitlint configuration file (
.commitlintrc.json, etc.) orcommitlintconfig inpackage.json - If no config exists, the workflow will create a default
.commitlintrc.jsonfile
The combined workflow includes:
- Draft PR handling - Automatically skips checks for draft PRs
- Selective execution - Control which checks run via inputs
- Default behavior - Runs all checks if no inputs specified
Inputs:
run-prettier(boolean, default:true) - Run Prettier checkrun-markdown(boolean, default:true) - Run Markdown lintrun-commits(boolean, default:true) - Run commit check
- Validates that a Prettier configuration exists
- Checks code formatting using Prettier
- Supports all Prettier-supported file types
- Uses Bun for package management
- Uses
rumdlv0.0.185 for fast Markdown linting - Checks all Markdown files in the repository
- Reports issues with GitHub annotations
- Validates PR titles follow conventional commit format
- Creates default commitlint config if missing (requires
package.json) - Uses Bun for package management
- Node.js 22+
- Bun (installed automatically in workflows)
- Uses the latest version of Bun