1+ #! /bin/bash
2+ 
3+ #  INPUT_${var} where var corresponds to those defined in action.yml uppercased
4+ # 
5+ #  Other env vars are those normally passed in by the github actions runner
6+ #  as defined here https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables
7+ 
8+ file=.
9+ project=contrast-local-scan-action-test
10+ 
11+ while  getopts  " f:p:" ;  do 
12+   case  $opt  in 
13+ 	  f) file=" $OPTARG " 
14+ 	  p) project=" $OPTARG " 
15+   esac 
16+ done 
17+ 
18+ docker run \
19+   -e INPUT_APIURL=$CONTRAST__API__URL  \
20+   -e INPUT_APIUSERNAME=$CONTRAST__API__USER_NAME  \
21+   -e INPUT_APIKEY=$CONTRAST__API__API_KEY  \
22+   -e INPUT_APISERVICEKEY=$CONTRAST__API__SERVICE_KEY  \
23+   -e INPUT_APIORGID=$CONTRAST__API__ORGANIZATION  \
24+   -e INPUT_DEFAULTBRANCH=false \
25+   -e INPUT_CHECKS=false \
26+   -e INPUT_CODEQUALITY=false \
27+   -e INPUT_LABEL=" local-test" 
28+   -e INPUT_TOKEN=unknown \
29+   -e INPUT_PROJECTNAME=$project  \
30+   -e INPUT_RESOURCEGROUP=scan \
31+   -e ACTIONS_RUNTIME_TOKEN=unknown \
32+   -e RUNNER_TEMP=/tmp \
33+   -e GITHUB_JOB=" local-test" 
34+   -e GITHUB_REF=" refs/local/test" 
35+   -e GITHUB_SHA=c9f043b \
36+   -e GITHUB_EVENT_NAME=" push" 
37+   -e GITHUB_REPOSITORY=contrast-local-scan-action-test \
38+   -e GITHUB_REPOSITORY_OWNER=Contrast-Security-OSS \
39+   -e GITHUB_REPOSITORY_OWNER_ID=1 \
40+   -e GITHUB_RUN_ID=1 \
41+   -e GITHUB_RUN_NUMBER=1 \
42+   -e GITHUB_WORKSPACE=/workspace \
43+   -e GITHUB_EVENT_PATH=/github/github-event.json \
44+   -w /workspace \
45+   -v ./target:/root/contrast-local-scanner/ \
46+   -v ./scripts/github-event.json:/github/github-event.json \
47+   -v $file :/workspace \
48+   $( docker build -q .) 
49+   
0 commit comments