fix(gh): Relativize file paths against GITHUB_WORKSPACE

This commit is contained in:
Andreas Dangel committed 2026-02-05 12:09:19 +01:00
1 parent 3141b83b60
commit 7f369e0e87
1 file changed
+6 -5
+6 -5
View File
@@ -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)::\"\(.typo)\" should be \"" + (.corrections // [] | join("\" or \"") + "\".")'
done