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
41 changes: 39 additions & 2 deletions .github/actions/base/markdown-check/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,35 @@ runs:
echo "files=${markdown_files[*]}" >> "$GITHUB_OUTPUT"
fi

- name: Install rumdl
- name: Detect rumdl in package.json
id: rumdl-deps
if: steps.resolved-markdown-files.outputs.any-changed == 'true'
shell: bash
working-directory: ${{ env.HOLDEX_WORKING_DIR || '.' }}
run: |
if [ -f package.json ] && grep -q '"rumdl"' package.json; then
echo "has-rumdl=true" >> "$GITHUB_OUTPUT"
else
echo "has-rumdl=false" >> "$GITHUB_OUTPUT"
fi

- name: Install dependencies
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 install --frozen-lockfile
elif [ "${{ inputs.package-manager }}" = "npm" ]; then
npm ci
else
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
Expand All @@ -83,4 +108,16 @@ runs:
if: steps.resolved-markdown-files.outputs.any-changed == 'true'
shell: bash
working-directory: ${{ env.HOLDEX_WORKING_DIR || '.' }}
run: rumdl check --output-format github --fail-on error ${{ steps.resolved-markdown-files.outputs.files }}
run: |
run_rumdl() {
if [ -x "./node_modules/.bin/rumdl" ]; then
./node_modules/.bin/rumdl "$@"
elif command -v rumdl >/dev/null 2>&1; then
rumdl "$@"
else
echo "::error::rumdl not found locally or globally." >&2
exit 1
fi
}

run_rumdl check --output-format github --fail-on error ${{ steps.resolved-markdown-files.outputs.files }}
4 changes: 3 additions & 1 deletion 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,7 +60,7 @@
- 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.
- Verifies a resolvable Prettier config exists.
- Runs `prettier --check --ignore-unknown` on changed files.
Expand All @@ -80,8 +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.
- Installs `rumdl` globally using selected package manager.
- 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.

Check warning on line 85 in ACTIONS.md

View workflow job for this annotation

GitHub Actions / checks / checks

MD013

Line length 92 exceeds 80 characters
Comment thread
teodorus-nathaniel marked this conversation as resolved.
- 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 Down
Loading