From 7f369e0e876e65d01f7f7b24852bed93d5c5d40b Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Thu, 5 Feb 2026 12:09:19 +0100 Subject: [PATCH] fix(gh): Relativize file paths against GITHUB_WORKSPACE --- action/format_gh.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/action/format_gh.sh b/action/format_gh.sh index b1361606..9b275e77 100755 --- a/action/format_gh.sh +++ b/action/format_gh.sh @@ -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