mirror of
https://github.com/crate-ci/typos.git
synced 2026-10-17 09:35:11 +02:00
11 lines
451 B
Bash
Executable File
11 lines
451 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set -eu
|
|
|
|
grep '"type":"typo"' | while IFS= read -r typo; do
|
|
original_path="$(echo "$typo" | jq --raw-output '.path')"
|
|
relative_path="$(realpath --relative-to="$GITHUB_WORKSPACE" "$original_path")"
|
|
echo "$typo" | jq --arg relative_path "$relative_path" --raw-output \
|
|
'"::warning file=\($relative_path),line=\(.line_num),col=\(.byte_offset + 1)::\"\(.typo)\" should be \"" + (.corrections // [] | join("\" or \"") + "\".")'
|
|
done
|