Last active
November 6, 2023 21:33
-
-
Save abronte/bf8d8816e8c8069e0c646ce2cf8d3821 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# check if semgrep is installed | |
if ! command -v semgrep &> /dev/null | |
then | |
echo "semgrep could not be found" | |
exit | |
fi | |
# check if snyk is installed | |
if ! command -v snyk &> /dev/null | |
then | |
echo "snyk could not be found" | |
exit | |
fi | |
CMD="$@" | |
echo "Running $CMD" | |
REPORT=$($CMD) | |
echo "Finished running scan." | |
echo "Uploading results to Corgea" | |
FILES=$(echo $REPORT | tr "," "\n" | grep '"path": ' | uniq) | |
for i in $FILES | |
do | |
if [[ ! $i == *'"path"'* ]]; then | |
echo $i | tr -d "\"" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment