-
Notifications
You must be signed in to change notification settings - Fork 183
/
check-spelling.yml
34 lines (31 loc) · 1.35 KB
/
check-spelling.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Checks spelling of files that changed between the current state of the repo
# and some ref (branch, tag, etc.) or commit hash. Only runs on PRs.
# ContinueOnError - true: Pipeline warns on spelling error
# false: Pipeline fails on spelling error
# TargetBranch - Target ref (e.g. main) to compare to create file change
# list.
# CspellConfigPath - Path to cspell.json config location
#
# This check recognizes the setting of variable "Skip.SpellCheck"
# if set to 'true', spellchecking will not be invoked.
parameters:
ContinueOnError: true
CspellConfigPath: ./.vscode/cspell.json
steps:
- ${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
- task: NodeTool@0
condition: and(succeededOrFailed(), ne(variables['Skip.SpellCheck'],'true'))
inputs:
versionSpec: 18.x
displayName: Use Node.js 18.x
- task: PowerShell@2
displayName: Check spelling (cspell)
condition: and(succeededOrFailed(), ne(variables['Skip.SpellCheck'],'true'))
continueOnError: ${{ parameters.ContinueOnError }}
inputs:
targetType: filePath
filePath: eng/common/scripts/check-spelling-in-changed-files.ps1
arguments: >-
-CspellConfigPath ${{ parameters.CspellConfigPath }}
-ExitWithError:(!$${{ parameters.ContinueOnError }})
pwsh: true