diff --git a/lint-checks/action.yaml b/lint-checks/action.yaml index 9d20909..ca9eabf 100644 --- a/lint-checks/action.yaml +++ b/lint-checks/action.yaml @@ -1,10 +1,10 @@ name: lint-checks description: > - Node formatting, linting, and conventional-commit checks: prettier - (`format:check`) and eslint (`lint`) npm scripts, each `--if-present`, - plus commitlint if the repo has a commitlint config. Run after - actions/checkout and npm ci (e.g. after node-checks), in a job with node - available. + Style and hygiene checks: prettier (via the repo's format:check script), + eslint (via the repo's lint script), and conventional-commit linting when + a commitlint config exists. Each check is --if-present/config-gated, so + repos opt in by defining the script or config. Run after node-checks in + the same job (needs node_modules from npm ci). runs: using: composite steps: @@ -13,18 +13,9 @@ runs: - run: npm run lint --if-present shell: bash - shell: bash - env: - GITHUB_EVENT_NAME: ${{ github.event_name }} - GITHUB_BASE_REF: ${{ github.base_ref }} run: | - set -euo pipefail if ls commitlint.config.* .commitlintrc* >/dev/null 2>&1; then - if [ "$GITHUB_EVENT_NAME" = "pull_request" ]; then - git fetch origin "$GITHUB_BASE_REF" --depth=1 - npx --yes commitlint --from "origin/$GITHUB_BASE_REF" --to HEAD - else - npx --yes commitlint --from HEAD~1 --to HEAD - fi + npx --no-install commitlint --last --verbose else - echo "no commitlint config found, skipping conventional-commit check" + echo "no commitlint config, skipping conventional-commit check" fi