Skip to content

Commit b927b3e

Browse files
committed
clean up path in sarif file
Signed-off-by: Anas Nashif <[email protected]>
1 parent c12af83 commit b927b3e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

.github/workflows/eclair.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,19 @@ jobs:
112112
run: |
113113
./scripts/twister -j 16 -p qemu_x86 -T samples/synchronization -i --build-only -v -xZEPHYR_SCA_VARIANT=eclair -x=USE_CCACHE=0 -xECLAIR_REPORTS_SARIF=1
114114
jq -s '{ "$schema": "https://json.schemastore.org/sarif-2.1.0", "version": "2.1.0", "runs": map(.runs) | add }' $(find twister-out -name "reports.sarif") > results.sarif
115+
jq --arg basepath "file:///${GITHUB_WORKSPACE}/" '
116+
.runs[].results[] |= (
117+
.locations[]? |= (
118+
.physicalLocation.artifactLocation.uri
119+
|= if type == "string" then ($basepath + .) else . end
120+
)
121+
| .relatedLocations[]? |= (
122+
.physicalLocation.artifactLocation.uri
123+
|= if type == "string" then ($basepath + .) else . end
124+
)
125+
)
126+
' results.sarif > results_tmp.sarif
127+
mv results_tmp.sarif results.sarif
115128

116129
ver=`git describe`
117130
echo "PAYLOAD_VERSION=${ver}" >> $GITHUB_ENV

0 commit comments

Comments
 (0)