Skip to content

Commit b353785

Browse files
committed
using the old way for jq
1 parent 8b0e54a commit b353785

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

analyze.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,9 @@ if [ "$BASE_PATH" != "" ]; then
7979
if [[ "$BASE_PATH" != */ ]]; then
8080
BASE_PATH="$BASE_PATH/"
8181
fi
82-
# using sourcepath does not work for sarif
83-
# CMD="$CMD -sourcepath ${BASE_PATH}"
82+
# using sourcepath does not work for GitHub's sarif parser
83+
# but keeping there just in case
84+
CMD="$CMD -sourcepath ${BASE_PATH}"
8485
fi
8586

8687
if [ "$ARGUMENTS" != "" ]; then
@@ -100,7 +101,7 @@ eval ${CMD}
100101
if [ "$OUTPUT_TYPE" == "sarif" ] && [ "$BASE_PATH" != "" ]; then
101102
# prepend the pyhsical path
102103
echo "Transform sarif file to include the physical path"
103-
jq -c "(.runs[].results[].locations[].physicalLocation.artifactLocation.uri) |=\"$BASE_PATH\"+." resultspre.sarif > "$OUTPUT"
104+
cat resultspre.sarif | jq -c "(.runs[].results[].locations[].physicalLocation.artifactLocation.uri) |=\"$BASE_PATH\"+." > "$OUTPUT"
104105
cat $OUTPUT
105106
fi
106107

0 commit comments

Comments
 (0)