Skip to content

Commit

Permalink
fix: output for non job-summary runs (#60)
Browse files Browse the repository at this point in the history
* chore(refactor): fix console and summary output
  • Loading branch information
timarenz authored Sep 21, 2023
1 parent 2e9e3ce commit 439c2c5
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/sh
set -o pipefail

# Set Lacework credentials as inline scanner environment variable
export LW_ACCOUNT_NAME=${INPUT_LW_ACCOUNT_NAME}
export LW_ACCESS_TOKEN=${INPUT_LW_ACCESS_TOKEN}

Expand Down Expand Up @@ -39,13 +41,12 @@ fi
# Remove old scanner evaluation, if cached somehow
rm ${GITHUB_WORKSPACE}/evaluations/${INPUT_IMAGE_NAME}/${INPUT_IMAGE_TAG}/evaluation_*.json &>/dev/null || true

# Run scanner
/opt/lacework/lw-scanner image evaluate ${INPUT_IMAGE_NAME} ${INPUT_IMAGE_TAG} \
--build-plan ${GITHUB_REPOSITORY} \
--build-id ${GITHUB_RUN_ID} \
--data-directory ${GITHUB_WORKSPACE} \
--policy \
--fail-on-violation-exit-code 1 ${SCANNER_PARAMETERS} 1> results.stdout
--build-plan ${GITHUB_REPOSITORY} \
--build-id ${GITHUB_RUN_ID} \
--data-directory ${GITHUB_WORKSPACE} \
--policy \
--fail-on-violation-exit-code 1 ${SCANNER_PARAMETERS} | tee results.stdout

export SCANNER_EXIT_CODE=$?

Expand All @@ -56,4 +57,4 @@ if [ "${INPUT_RESULTS_IN_GITHUB_SUMMARY}" = "true" ]; then
echo "</pre>" >> $GITHUB_STEP_SUMMARY
fi

exit ${SCANNER_EXIT_CODE}
exit ${SCANNER_EXIT_CODE}

0 comments on commit 439c2c5

Please sign in to comment.