mirror of
https://github.com/crate-ci/typos.git
synced 2026-10-21 16:16:14 +02:00
Merge pull request #1496 from adangel/fix-action-annotations
GitHub Actions annotations not showing up
This commit is contained in:
1 file changed
+6
-5
+6
-5
@@ -2,8 +2,9 @@
|
||||
|
||||
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
|
||||
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
|
||||
Reference in new issue
Block a user