Skip to content

Commit

Permalink
Exclude /dist /vendor
Browse files Browse the repository at this point in the history
  • Loading branch information
szepeviktor authored Oct 27, 2023
1 parent a3a6836 commit fa36d9e
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions .github/workflows/spelling.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

name: "Spelling"

on: # yamllint disable-line rule:truthy
on:
workflow_dispatch:
inputs:
repository:
Expand All @@ -25,9 +25,24 @@ jobs:
steps:
-
name: "Checkout repository"
uses: "actions/checkout@v3"
uses: "actions/checkout@v4"
with:
repository: "${{ inputs.repository }}"
-
name: "Search for misspellings"
uses: "crate-ci/typos@master"
env:
GH_TOKEN: "${{ github.token }}"
run: |
set -o pipefail
mkdir -p "${{ runner.temp }}/typos"
RELEASE_ASSET_URL="$(
gh api /repos/crate-ci/typos/releases/latest \
--jq '."assets"[] | select(."name" | test("^typos-.+-x86_64-unknown-linux-musl\\.tar\\.gz$")) | ."browser_download_url"'
)"
wget --secure-protocol=TLSv1_3 --max-redirect=1 --retry-on-host-error --retry-connrefused --tries=3 \
--quiet --output-document=- "${RELEASE_ASSET_URL}" \
| tar -xz -C "${{ runner.temp }}/typos" ./typos
"${{ runner.temp }}/typos/typos" --version
git grep --files-with-matches --null -I -e '.' -- ':!:dist/' ':!:vendor/' \
| xargs --null --verbose -- "${{ runner.temp }}/typos/typos" --format json \
| jq --raw-output '"::warning file=\(.path),line=\(.line_num),col=\(.byte_offset)::\"\(.typo)\" should be \"" + (.corrections // [] | join("\" or \"") + "\".")'

0 comments on commit fa36d9e

Please sign in to comment.