diff --git a/docker/Dockerfile b/docker/Dockerfile index f94c3d3..93bfddf 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,7 +1,7 @@ FROM ubuntu:20.04 ARG VERSION=1.9.0 ENV VERSION=${VERSION} -RUN apt-get update && apt-get install -y wget git +RUN apt-get update && apt-get install -y wget git jq RUN wget https://github.com/crate-ci/typos/releases/download/v${VERSION}/typos-v${VERSION}-x86_64-unknown-linux-musl.tar.gz && \ tar -xzvf typos-v${VERSION}-x86_64-unknown-linux-musl.tar.gz && \ mv typos /usr/local/bin diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index 8e16d3c..604e451 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -40,4 +40,9 @@ if [[ -n "${INPUT_CONFIG:-}" ]]; then fi log "$ ${COMMAND}" +${COMMAND} --format json | + 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 || true ${COMMAND}