diff --git a/.github/workflows/spell_check.yml b/.github/workflows/spell_check.yml index 7f363ae..ca52a03 100644 --- a/.github/workflows/spell_check.yml +++ b/.github/workflows/spell_check.yml @@ -23,6 +23,10 @@ on: required: false type: boolean default: true + check_pr_title: + required: false + type: boolean + default: false working_directory: required: false type: string @@ -48,3 +52,9 @@ jobs: incremental_files_only: ${{inputs.modified_files_only}} root: ${{inputs.working_directory}} verbose: ${{inputs.verbose}} + + - name: 🪄 Spell Check PR Title + if: inputs.check_pr_title && github.event_name == 'pull_request' + env: + PR_TITLE: ${{ github.event.pull_request.title }} + run: echo "$PR_TITLE" | npx --yes cspell@8 stdin --config "${{inputs.config}}" --no-progress --no-summary diff --git a/site/docs/workflows/spell_check.md b/site/docs/workflows/spell_check.md index 6c01d6b..5eb89a2 100644 --- a/site/docs/workflows/spell_check.md +++ b/site/docs/workflows/spell_check.md @@ -12,6 +12,7 @@ The spell check workflow consists of the following steps: 1. Git checkout 2. Run spell check +3. Run spell check on the pull request title (when `check_pr_title` is enabled) ## Inputs @@ -51,6 +52,12 @@ The spell check workflow consists of the following steps: **Default** `true` +### `check_pr_title` + +**Optional** An optional boolean which determines whether the pull request title is spell checked using the same `config`. Only runs on `pull_request` events. + +**Default** `false` + ## Example Usage ```yaml @@ -68,6 +75,7 @@ jobs: .*/**/*.yml runs_on: macos-latest modified_files_only: false + check_pr_title: true working_directory: examples/my_project ```