typos/action/format_gh.sh
WaterLemons2k 6855a78893 feat(ci): Use composite to run action
Using composite instead of docker to avoid building image,
it can make the action faster.

If the `typos` command doesn't exist, download and extract it.
2023-03-14 23:04:09 +08:00

9 lines
274 B
Bash
Executable file

#!/bin/bash
set -eu
grep '"type":"typo"' |
jq --sort-keys --raw-output '"::warning file=\(.path),line=\(.line_num),col=\(.byte_offset)::\"\(.typo)\" should be \"" + (.corrections // [] | join("\" or \"") + "\".")' |
while IFS= read -r line; do
echo "$line"
done