Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
amacedoo committed Sep 16, 2024
1 parent 715af5f commit 6c4be33
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

output_file=/app/output.log

# Create file and add permissions
# Create file
touch $output_file

cd /app
Expand All @@ -11,6 +11,8 @@ eval "arr=(${ADDITIONAL_PARAMS})"
/app/bin/cx scan create --project-name "${PROJECT_NAME}" -s "." --branch "${BRANCH#refs/heads/}" --scan-info-format json --agent "Github Action" "${arr[@]}" | tee -i $output_file
exitCode=${PIPESTATUS[0]}

chown nonroot:nonroot $output_file

scanId=(`grep -E '"(ID)":"((\\"|[^"])*)"' $output_file | cut -d',' -f1 | cut -d':' -f2 | tr -d '"'`)

echo "cxcli=$(cat $output_file | tr -d '\r\n')" >> $GITHUB_OUTPUT
Expand All @@ -25,6 +27,9 @@ fi

if [ -n "$scanId" ]; then
/app/bin/cx results show --scan-id "${scanId}" --report-format markdown

chown nonroot:nonroot cx_result.md

cat ./cx_result.md >$GITHUB_STEP_SUMMARY
rm ./cx_result.md
echo "cxScanID=$scanId" >> $GITHUB_OUTPUT
Expand Down

0 comments on commit 6c4be33

Please sign in to comment.