Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 12 additions & 15 deletions .github/actions/base/commit-check/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,6 @@ inputs:
runs:
using: composite
steps:
- name: Install commitlint CLI
if: github.event_name == 'pull_request'
shell: bash
working-directory: ${{ env.HOLDEX_WORKING_DIR || '.' }}
run: |
if [ "${{ inputs.package-manager }}" = "pnpm" ]; then
pnpm add -g @commitlint/cli
elif [ "${{ inputs.package-manager }}" = "npm" ]; then
npm install -g @commitlint/cli
else
bun i -g @commitlint/cli
fi

- name: Check for commitlint config
id: commitlint-config
if: github.event_name == 'pull_request'
Expand Down Expand Up @@ -69,8 +56,18 @@ runs:
env:
PR_TITLE: ${{ github.event.pull_request.title }}
run: |
run_commitlint() {
if [ "${{ inputs.package-manager }}" = "pnpm" ]; then
pnpm dlx @commitlint/cli "$@"
elif [ "${{ inputs.package-manager }}" = "npm" ]; then
npx --yes @commitlint/cli "$@"
else
bunx @commitlint/cli "$@"
fi
}

if [ "${{ steps.commitlint-config.outputs.has-config }}" = "true" ]; then
echo "$PR_TITLE" | commitlint
echo "$PR_TITLE" | run_commitlint
else
echo "$PR_TITLE" | commitlint --default-config
echo "$PR_TITLE" | run_commitlint --default-config
fi
22 changes: 5 additions & 17 deletions .github/actions/base/markdown-check/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,19 +85,6 @@ runs:
bun i --frozen-lockfile
fi

- name: Install rumdl (fallback)
if: steps.resolved-markdown-files.outputs.any-changed == 'true' && steps.rumdl-deps.outputs.has-rumdl != 'true'
shell: bash
working-directory: ${{ env.HOLDEX_WORKING_DIR || '.' }}
run: |
if [ "${{ inputs.package-manager }}" = "pnpm" ]; then
pnpm add -g rumdl
elif [ "${{ inputs.package-manager }}" = "npm" ]; then
npm install -g rumdl
else
bun i -g rumdl
fi

- name: Skip when no markdown files changed
if: steps.resolved-markdown-files.outputs.any-changed != 'true'
shell: bash
Expand All @@ -112,11 +99,12 @@ runs:
run_rumdl() {
if [ -x "./node_modules/.bin/rumdl" ]; then
./node_modules/.bin/rumdl "$@"
elif command -v rumdl >/dev/null 2>&1; then
rumdl "$@"
elif [ "${{ inputs.package-manager }}" = "pnpm" ]; then
pnpm dlx rumdl "$@"
elif [ "${{ inputs.package-manager }}" = "npm" ]; then
npx --yes rumdl "$@"
else
echo "::error::rumdl not found locally or globally." >&2
exit 1
bunx rumdl "$@"
fi
}

Expand Down
36 changes: 10 additions & 26 deletions .github/actions/base/prettier/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,24 +60,6 @@ runs:
echo "No package.json found, skipping dependency installation."
fi

- name: Install Prettier (fallback)
if: steps.resolved-files.outputs.any-changed == 'true'
shell: bash
working-directory: ${{ env.HOLDEX_WORKING_DIR || '.' }}
run: |
if [ -x "./node_modules/.bin/prettier" ]; then
echo "Using project-local Prettier."
exit 0
fi

if [ "${{ inputs.package-manager }}" = "pnpm" ]; then
pnpm add -g prettier
elif [ "${{ inputs.package-manager }}" = "npm" ]; then
npm install -g prettier
else
bun i -g prettier
fi

- name: Check for Prettier config
id: prettier-config
if: steps.resolved-files.outputs.any-changed == 'true'
Expand All @@ -87,11 +69,12 @@ runs:
run_prettier() {
if [ -x "./node_modules/.bin/prettier" ]; then
./node_modules/.bin/prettier "$@"
elif command -v prettier >/dev/null 2>&1; then
prettier "$@"
elif [ "${{ inputs.package-manager }}" = "pnpm" ]; then
pnpm dlx prettier "$@"
elif [ "${{ inputs.package-manager }}" = "npm" ]; then
npx --yes prettier "$@"
else
echo "::error::Prettier not found locally or globally." >&2
exit 1
bunx prettier "$@"
fi
}

Expand Down Expand Up @@ -126,11 +109,12 @@ runs:
run_prettier() {
if [ -x "./node_modules/.bin/prettier" ]; then
./node_modules/.bin/prettier "$@"
elif command -v prettier >/dev/null 2>&1; then
prettier "$@"
elif [ "${{ inputs.package-manager }}" = "pnpm" ]; then
pnpm dlx prettier "$@"
elif [ "${{ inputs.package-manager }}" = "npm" ]; then
npx --yes prettier "$@"
else
echo "::error::Prettier not found locally or globally." >&2
exit 1
bunx prettier "$@"
fi
}

Expand Down
12 changes: 6 additions & 6 deletions ACTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
- Intended as the first step before calling local-path actions from that checkout.

> [!WARNING]
> Keep `base/checkout` backward compatible. Workflows reference the action as `.../base/checkout@main`, so any breaking change merged to this repo’s `main` will immediately break consumers.

Check warning on line 28 in ACTIONS.md

View workflow job for this annotation

GitHub Actions / checks / checks

MD013

Line length 189 exceeds 80 characters
>
> This also applies to the `ref` input: existing workflows often pass `ref: main` (a branch name) for the _target_ repo checkout, so don’t change `ref` semantics in a way that would require a commit SHA.

Check warning on line 30 in ACTIONS.md

View workflow job for this annotation

GitHub Actions / checks / checks

MD013

Line length 203 exceeds 80 characters

### `base/setup-runtime`

Expand All @@ -42,7 +42,7 @@
- Validates allowed `package-manager` values.
- For `bun`: installs Bun runtime.
- For `pnpm`/`npm`: installs Node.js.
- For `pnpm`: installs pnpm using `package.json#packageManager` when present, otherwise falls back to `latest`.

Check warning on line 45 in ACTIONS.md

View workflow job for this annotation

GitHub Actions / checks / checks

MD013

Line length 111 exceeds 80 characters
- Respects `HOLDEX_WORKING_DIR` env var for `package.json` detection when set.

### `base/prettier`
Expand All @@ -60,8 +60,8 @@
- Skips execution if no changed files exist.
- Runs dependency install in repo context when `package.json` exists:
- `bun i --frozen-lockfile`, `pnpm install --frozen-lockfile`, or `npm ci`.
- Uses project-local Prettier (`./node_modules/.bin/prettier`) when available after dependency install.

Check warning on line 63 in ACTIONS.md

View workflow job for this annotation

GitHub Actions / checks / checks

MD013

Line length 103 exceeds 80 characters
- Installs Prettier globally as a fallback only when no local binary is found.
- Falls back to `pnpm dlx` / `npx` / `bunx prettier` when no local binary is found.
- Verifies a resolvable Prettier config exists.
- Runs `prettier --check --ignore-unknown` on changed files.
- Respects `HOLDEX_WORKING_DIR` env var: all steps run in that directory when set.
Expand All @@ -80,10 +80,10 @@
- Discovers changed markdown files (`.md`, `.mdx`) if `changed-files` is not provided.
- Filters/uses markdown-only changed files.
- Skips execution if no markdown files changed.
- If `rumdl` is declared in `package.json`, installs project dependencies with frozen lockfile.

Check warning on line 83 in ACTIONS.md

View workflow job for this annotation

GitHub Actions / checks / checks

MD013

Line length 95 exceeds 80 characters
- Otherwise installs `rumdl` globally using selected package manager.
- Uses project-local `rumdl` (`./node_modules/.bin/rumdl`) when available, otherwise global.
- Uses project-local `rumdl` (`./node_modules/.bin/rumdl`) when available.
- Otherwise falls back to `pnpm dlx` / `npx` / `bunx rumdl`.
- Runs `rumdl check --output-format github --fail-on error` on changed markdown files.

Check warning on line 86 in ACTIONS.md

View workflow job for this annotation

GitHub Actions / checks / checks

MD013

Line length 86 exceeds 80 characters
- Respects `HOLDEX_WORKING_DIR` env var: all steps run in that directory when set.

### `base/commit-check`
Expand All @@ -97,12 +97,12 @@
#### Behavior

- Runs only on `pull_request` events for install/config/check steps.
- Installs commitlint CLI globally using selected package manager.
- Detects commitlint configuration from standard config files or `package.json`.
- If config exists, installs dependencies in repo context:
- `bun i --frozen-lockfile`, `pnpm install --frozen-lockfile`, or `npm ci`.
- If config does not exist, validates using `commitlint --default-config`.
- Validates PR title via `commitlint`.
- Runs `@commitlint/cli` via `pnpm dlx` / `npx` / `bunx` (no global install).
- If config does not exist, validates using `--default-config`.
- Validates PR title via commitlint.
- Respects `HOLDEX_WORKING_DIR` env var: all steps run in that directory when set.

## Composed Actions
Expand Down
Loading