fix(regression): invalid json output. (#930)
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
This commit is contained in:
parent
15cb0ce053
commit
7839ede089
1
.github/workflows/test.yml
vendored
1
.github/workflows/test.yml
vendored
@ -3,7 +3,6 @@ name: CI
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
|
||||||
- "**"
|
- "**"
|
||||||
pull_request:
|
pull_request:
|
||||||
types:
|
types:
|
||||||
|
@ -52,13 +52,13 @@ function get_dirname_max_depth() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function json_output() {
|
function json_output() {
|
||||||
JQ_ARGS="-R"
|
JQ_ARGS="-sR"
|
||||||
if [[ "$INPUT_JSON_RAW_FORMAT" == "true" ]]; then
|
if [[ "$INPUT_JSON_RAW_FORMAT" == "true" ]]; then
|
||||||
JQ_ARGS="$JQ_ARGS -r"
|
JQ_ARGS="$JQ_ARGS -r"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
jq $JQ_ARGS 'split("\n") | @json' | tr -s /
|
jq $JQ_ARGS 'split("\n") | map(select(. != "")) | @json' | sed -r 's/^"|"$//g' | tr -s /
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_diff() {
|
function get_diff() {
|
||||||
|
@ -1 +1 @@
|
|||||||
This is a test file
|
This is a test file.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user