From cf21b70f6f60876c35db9202552fe1d25bffb873 Mon Sep 17 00:00:00 2001 From: Aaron Bull Schaefer Date: Mon, 22 Jun 2026 10:28:57 -0700 Subject: [PATCH] Install stylelint-config-recess-order and stylint-config-standard --- .github/workflows/check-stylelint.yml | 19 ++++++++++++++++++- docs/common.md | 17 ++++++++++------- 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/.github/workflows/check-stylelint.yml b/.github/workflows/check-stylelint.yml index 3f2358e..29aae2b 100644 --- a/.github/workflows/check-stylelint.yml +++ b/.github/workflows/check-stylelint.yml @@ -6,6 +6,12 @@ on: files: type: string default: "**/*.css" + stylelint_config_recess_order_version: + type: string + default: "latest" + stylelint_config_standard_version: + type: string + default: "latest" stylelint_version: type: string default: "latest" @@ -23,7 +29,10 @@ jobs: - name: Lint CSS files env: INPUTS_FILES: ${{ inputs.files }} + INPUTS_STYLELINT_CONFIG_RECESS_ORDER_VERSION: ${{ inputs.stylelint_config_recess_order_version }} + INPUTS_STYLELINT_CONFIG_STANDARD_VERSION: ${{ inputs.stylelint_config_standard_version }} INPUTS_STYLELINT_VERSION: ${{ inputs.stylelint_version }} + # zizmor: ignore[adhoc-packages] This reusable workflow intentionally installs caller-selected stylelint packages on ephemeral runners. run: | set -euo pipefail @@ -35,4 +44,12 @@ jobs: # Split INPUTS_FILES into an array (space-separated) IFS=' ' read -r -a files <<<"$INPUTS_FILES" - npx --yes "stylelint@${INPUTS_STYLELINT_VERSION}" -- "${files[@]}" + npm install \ + --no-save \ + --no-package-lock \ + --ignore-scripts \ + "stylelint@${INPUTS_STYLELINT_VERSION}" \ + "stylelint-config-recess-order@${INPUTS_STYLELINT_CONFIG_RECESS_ORDER_VERSION}" \ + "stylelint-config-standard@${INPUTS_STYLELINT_CONFIG_STANDARD_VERSION}" + + npx --no-install stylelint -- "${files[@]}" diff --git a/docs/common.md b/docs/common.md index 1d03365..7e8f143 100644 --- a/docs/common.md +++ b/docs/common.md @@ -144,16 +144,19 @@ Detects common misspellings across files using ## check-stylelint.yml -Lints CSS files using [stylelint](https://stylelint.io/). By default, it runs -the latest published stylelint package through `npx`; callers can pin -`stylelint_version` when they need a fixed version. +Lints CSS files using [stylelint](https://stylelint.io/). By default, it +installs the latest published `stylelint`, `stylelint-config-standard`, and +`stylelint-config-recess-order` packages into the runner workspace; callers can +pin package versions when they need fixed versions. **Inputs** -| Name | Required | Default | -| ------------------- | -------- | ---------- | -| `files` | false | `**/*.css` | -| `stylelint_version` | false | `latest` | +| Name | Required | Default | +| --------------------------------------- | -------- | ---------- | +| `files` | false | `**/*.css` | +| `stylelint_config_recess_order_version` | false | `latest` | +| `stylelint_config_standard_version` | false | `latest` | +| `stylelint_version` | false | `latest` | **Typical usage with changed files**