diff --git a/.github/actions/base/commit-check/action.yml b/.github/actions/base/commit-check/action.yml index 36c16c8..c0f5a92 100644 --- a/.github/actions/base/commit-check/action.yml +++ b/.github/actions/base/commit-check/action.yml @@ -62,27 +62,6 @@ runs: bun i --frozen-lockfile fi - - name: Install commitlint globally if no config - if: github.event_name == 'pull_request' && steps.commitlint-config.outputs.has-config == 'false' - shell: bash - working-directory: ${{ env.HOLDEX_WORKING_DIR || '.' }} - run: | - if [ "${{ inputs.package-manager }}" = "pnpm" ]; then - pnpm add -D @commitlint/config-conventional - elif [ "${{ inputs.package-manager }}" = "npm" ]; then - npm install --save-dev @commitlint/config-conventional - else - bun i -D @commitlint/config-conventional - fi - - - name: Create commitlint config if missing - if: github.event_name == 'pull_request' && steps.commitlint-config.outputs.has-config == 'false' - shell: bash - working-directory: ${{ env.HOLDEX_WORKING_DIR || '.' }} - run: | - echo "extends:" > .commitlintrc.yml - echo " - '@commitlint/config-conventional'" >> .commitlintrc.yml - - name: Check PR title if: github.event_name == 'pull_request' shell: bash @@ -90,4 +69,8 @@ runs: env: PR_TITLE: ${{ github.event.pull_request.title }} run: | - echo "$PR_TITLE" | commitlint + if [ "${{ steps.commitlint-config.outputs.has-config }}" = "true" ]; then + echo "$PR_TITLE" | commitlint + else + echo "$PR_TITLE" | commitlint --default-config + fi diff --git a/ACTIONS.md b/ACTIONS.md index 04c378e..7d54737 100644 --- a/ACTIONS.md +++ b/ACTIONS.md @@ -98,7 +98,7 @@ Path: `/.github/actions/base/commit-check` - 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, installs `@commitlint/config-conventional` and creates fallback `.commitlintrc.yml`. +- If config does not exist, validates using `commitlint --default-config`. - Validates PR title via `commitlint`. - Respects `HOLDEX_WORKING_DIR` env var: all steps run in that directory when set.