Skip to content

Commit 9be5978

Browse files
authored
Merge pull request #47 from bnreplah/master
Added Policy Parameter for Create Profile
2 parents f7e1fbf + b58a34e commit 9be5978

File tree

4 files changed

+28
-10
lines changed

4 files changed

+28
-10
lines changed

.github/workflows/main.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
with:
2727
distribution: 'adopt'
2828
java-version: '8'
29-
- uses: actions/upload-artifact@v3
29+
- uses: actions/upload-artifact@v4.6.2
3030
with:
3131
path: binaries_to_upload/*.jar
3232
- name: Veracode Upload and Scan Action Step
@@ -42,4 +42,5 @@ jobs:
4242
sandboxname: 'Github - ${{ github.ref }}'
4343
scantimeout: 15
4444
criticality: 'VeryHigh'
45-
createprofile: false
45+
createprofile: true
46+
policy: 'Test policy 2'

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,10 @@ Veracode recommends that you use the toplevel parameter if you want to ensure th
124124

125125
**Optional** INTEGER - Number of times to retry the last request during certain error conditions or when a request times out. Value range is 1 to 5. Default is 5
126126

127+
### `policy`
128+
129+
**Optional** STRING - The policy name that matches the policy in the Veracode platform you want to assign to the application profile on creation. Default is '' and the [`criticality`](README.md#criticality) will be used.
130+
127131
## Examples
128132

129133
### General Usage

action.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@ inputs:
8383
description: 'Number of times to retry the last request during certain error conditions or when a request times out. Value range is 1 to 5.'
8484
required: false
8585
default: 5
86+
policy:
87+
description: 'Veracode Policy Name'
88+
required: false
89+
default: ''
8690

8791

8892
# outputs:
@@ -118,3 +122,4 @@ runs:
118122
- ${{ inputs.debug }}
119123
- ${{ inputs.includenewmodules }}
120124
- ${{ inputs.maxretrycount }}
125+
- ${{ inputs.policy }}

entrypoint.sh

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/bin/sh -l
2+
parameters=[ appname, createprofile, filepath, version, vid, vkey, createsandbox, sandboxname, scantimeout,exclude, include, criticality, pattern, replacement, sandboxid,scanallnonfataltoplevelmodules,selected,selectedpreviously, teams, toplevel, deleteincompletescan, scanpollinginterval, javawrapperversion, debug, includenewmodules, maxretrycount, policy]
23

34
#required parameters
45
appname=$1
@@ -30,22 +31,23 @@ javawrapperversion=${23}
3031
debug=${24}
3132
includenewmodules=${25}
3233
maxretrycount=${26}
33-
34+
policy=${27}
3435

3536
echo "Required Information"
3637
echo "===================="
3738
echo "appname: $appname"
3839
echo "createprofile: $createprofile"
3940
echo "filepath: $filepath"
4041
echo "version: $version"
41-
if [ "$vid" ]
42+
#echo "policy: $policy"
43+
if [ "$vid" || "${5}" ]
4244
then
4345
echo "vid: ***"
4446
else
4547
echo "vid:"
4648
fi
4749

48-
if [ "$vkey" ]
50+
if [ "$vkey" || "${6}" ]
4951
then
5052
echo "vkey: ***"
5153
else
@@ -54,9 +56,9 @@ fi
5456
echo ""
5557
echo "Optional Information"
5658
echo "===================="
57-
echo "createsandbox: $createsandbox"
58-
echo "sandboxname: $8"
59-
echo "scantimeout: $9"
59+
echo "createsandbox: ${7}" #createsandbox" # why is this in a differnt convention ?
60+
echo "sandboxname: ${8}"
61+
echo "scantimeout: ${9}"
6062
echo "exclude: ${10}"
6163
echo "include: ${11}"
6264
echo "criticality: ${12}"
@@ -74,6 +76,7 @@ echo "javawrapperversion: ${23}"
7476
echo "debug: ${24}"
7577
echo "includenewmodules: ${25}"
7678
echo "maxretrycount: ${26}"
79+
echo "policy: ${27}"
7780

7881

7982
#Check if required parameters are set
@@ -270,7 +273,12 @@ then
270273
echo " -maxretrycount \"$maxretrycount\" \\" >> runJava.sh
271274
fi
272275

276+
if [ "$policy" ]
277+
then
278+
echo " -policy \"$policy\" \\" >> runJava.sh
279+
fi
280+
273281
curl -sS -o VeracodeJavaAPI.jar "https://repo1.maven.org/maven2/com/veracode/vosp/api/wrappers/vosp-api-wrappers-java/$javawrapperversion/vosp-api-wrappers-java-$javawrapperversion.jar"
274-
chmod 777 runJava.sh
275-
cat runJava.sh
282+
chmod 777 runJava.sh # does it need full 7 ?
283+
cat runJava.sh
276284
./runJava.sh

0 commit comments

Comments
 (0)