Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix for [BUG] wrong workflow summary for async scans #133 #134

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,17 @@ exitCode=${PIPESTATUS[0]}

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

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

if [ -n "$scanId" ] && [ -n "${PR_NUMBER}" ]; then
echo "Creating PR decoration for scan ID:" $scanId
/app/bin/cx utils pr github --scan-id "${scanId}" --namespace "${NAMESPACE}" --repo-name "${REPO_NAME}" --pr-number "${PR_NUMBER}" --token "${GITHUB_TOKEN}"
else
echo "PR decoration not created."
fi


if [ -n "$scanId" ]; then
# only generate step summary if scan is no longer running
if [ -n "$scanId" ] && [ "$scanStatus" != "Running" ]; then
/app/bin/cx results show --scan-id "${scanId}" --report-format markdown
cat ./cx_result.md >$GITHUB_STEP_SUMMARY
rm ./cx_result.md
Expand Down