Skip to content

Commit

Permalink
fix: merge with master- entrypoint
Browse files Browse the repository at this point in the history
  • Loading branch information
krol3 committed Jul 30, 2022
1 parent 5144f05 commit 8e0f99e
Show file tree
Hide file tree
Showing 7 changed files with 357 additions and 3,348 deletions.
1 change: 1 addition & 0 deletions .vscode/configurationCache.log
@@ -0,0 +1 @@
{"buildTargets":["test"],"launchTargets":[],"customConfigurationProvider":{"workspaceBrowse":{"browsePath":[],"compilerArgs":[]},"fileIndex":[]}}
5 changes: 5 additions & 0 deletions .vscode/dryrun.log
@@ -0,0 +1,5 @@
make --dry-run --always-make --keep-going --print-directory
make: Entering directory '/home/krol/workspace/fork/aquasecurity/trivy-action'
BATS_LIB_PATH=/usr/local/lib/ bats -r .
make: Leaving directory '/home/krol/workspace/fork/aquasecurity/trivy-action'

3 changes: 3 additions & 0 deletions .vscode/settings.json
@@ -0,0 +1,3 @@
{
"makefile.extensionOutputFolder": "./.vscode"
}
323 changes: 323 additions & 0 deletions .vscode/targets.log

Large diffs are not rendered by default.

14 changes: 9 additions & 5 deletions entrypoint.sh
Expand Up @@ -167,9 +167,9 @@ if [ $trivyConfig ]; then
trivy --config $trivyConfig ${scanType} ${artifactRef}
returnCode=$?
else
echo "Running trivy with options: ${ARGS}" "${artifactRef}"
echo "Running trivy with options: trivy ${scanType} ${ARGS}" "${artifactRef}"
echo "Global options: " "${GLOBAL_ARGS}"
trivy $GLOBAL_ARGS ${scanType} $ARGS ${artifactRef}
trivy $GLOBAL_ARGS ${scanType} ${ARGS} ${artifactRef}
returnCode=$?
fi

Expand All @@ -181,9 +181,13 @@ if [[ "${format}" == "sarif" ]]; then
trivy --quiet ${scanType} --format sarif --output ${output} $SARIF_ARGS ${artifactRef}
fi

if [[ "${format}" == "github" ]] && [[ "$(echo $githubPAT | xargs)" != "" ]]; then
echo "Uploading GitHub Dependency Snapshot"
curl -u "${githubPAT}" -H 'Content-Type: application/json' 'https://api.github.com/repos/'$GITHUB_REPOSITORY'/dependency-graph/snapshots' -d @./$(echo $output | xargs)
if [[ "${format}" == "github" ]]; then
if [[ "$(echo $githubPAT | xargs)" != "" ]]; then
printf "\n Uploading GitHub Dependency Snapshot"
curl -u "${githubPAT}" -H 'Content-Type: application/json' 'https://api.github.com/repos/'$GITHUB_REPOSITORY'/dependency-graph/snapshots' -d @./$(echo $output | xargs)
else
printf "\n Failing GitHub Dependency Snapshot. Missing github-pat"
fi
fi

exit $returnCode
3,357 changes: 15 additions & 3,342 deletions test/data/image-sarif.test

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion test/test.bats
Expand Up @@ -80,4 +80,4 @@ bats_load_library bats-file
run diff yamlconfig.test ./test/data/yamlconfig.test
echo "$output"
assert_files_equal yamlconfig.test ./test/data/yamlconfig.test
}
}

0 comments on commit 8e0f99e

Please sign in to comment.