From 5b18d98d60ab19722fd5c48a199fc317bb984c63 Mon Sep 17 00:00:00 2001 From: Lilith Hafner Date: Mon, 16 Oct 2023 09:09:51 -0500 Subject: [PATCH] use home-rolled typos --- .github/workflows/SpellCheck.yml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/SpellCheck.yml b/.github/workflows/SpellCheck.yml index ee0aa5ff3ba91..1371b7e7f6f01 100644 --- a/.github/workflows/SpellCheck.yml +++ b/.github/workflows/SpellCheck.yml @@ -15,4 +15,18 @@ jobs: with: persist-credentials: false - name: Check spelling with typos - uses: crate-ci/typos@master + #uses: crate-ci/typos@master + 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 diff-index --name-only --diff-filter=d -z ${{ github.base_ref }} \ + | xargs -0"${{ runner.temp }}/typos/typos" --format json \ + | jq --raw-output '"::warning file=\(.path),line=\(.line_num),col=\(.byte_offset)::perhaps \"\(.typo)\" should be \"" + (.corrections // [] | join("\" or \"") + "\".")' \ No newline at end of file