Skip to content

Commit dae40f5

Browse files
authored
Merge pull request #56 from veracode/rewriteToTS
Rewrite action to TypeScript and remove Docker requirements
2 parents 1194f1d + a048e2f commit dae40f5

File tree

11 files changed

+782
-384
lines changed

11 files changed

+782
-384
lines changed

.github/workflows/policyscan.yml

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,13 @@ jobs:
1717
# Steps represent a sequence of tasks that will be executed as part of the job
1818
steps:
1919
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
20-
- uses: actions/checkout@v3
21-
- uses: actions/setup-java@v2 # Make java accessible on path so the uploadandscan action can run.
22-
with:
23-
distribution: 'adopt'
24-
java-version: '8'
25-
26-
# zip the project and move it to a staging directory
27-
- name: Zip Project
28-
run: zip -R project.zip '*.py' '*.html' '*.htm' '*.js' '*.php' 'requirements.txt' '*.json' '*.lock' '*.ts' '*.pl' '*.pm' '*.plx' '*.pl5' '*.cgi' '*.go' '*.sum' '*.mod'
29-
env:
30-
build-name: project.zip
31-
- uses: actions/upload-artifact@v3 # Copy files from repository to docker container so the next uploadandscan action can access them.
32-
with:
33-
path: project.zip # Wildcards can be used to filter the files copied into the container. See: https://github.com/actions/upload-artifact
34-
- uses: veracode/veracode-uploadandscan-action@master # Run the uploadandscan action. Inputs are described above.
20+
- uses: actions/checkout@v4
21+
# Run the uploadandscan action. Inputs are described above.
22+
- uses: veracode/veracode-uploadandscan-action@rewriteToTS
3523
with:
3624
appname: '${{ github.repository }}'
3725
version: '${{ github.run_id }}'
38-
filepath: 'project.zip'
26+
filepath: 'binaries_to_upload/hello.jar'
3927
vid: '${{ secrets.VERACODE_API_ID }}'
4028
vkey: '${{ secrets.VERACODE_API_KEY }}'
4129
scantimeout: 15

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
node_modules/
2+
*.log
13
.DS_Store
2-
runJava.sh
34
VeracodeJavaAPI.jar
5+
Dockerfile
6+
entrypoint.sh

Dockerfile

Lines changed: 0 additions & 14 deletions
This file was deleted.

README.md

Lines changed: 2 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -147,13 +147,13 @@ jobs:
147147

148148
steps:
149149
- name: Check out main branch
150-
uses: actions/checkout@v2
150+
uses: actions/checkout@v3
151151

152152
- name: Build with Maven # Compiling the .war binary from the checked out repo source code to upload to the scanner in the next step
153153
run: mvn -B package --file app/pom.xml
154154

155155
- name: Veracode Upload And Scan
156-
uses: veracode/veracode-uploadandscan-action@0.2.6
156+
uses: veracode/veracode-uploadandscan-action@0.2.10
157157
with:
158158
appname: 'VeraDemo'
159159
createprofile: false
@@ -167,40 +167,3 @@ jobs:
167167
# include: '*.war'
168168
# criticality: 'VeryHigh'
169169
```
170-
171-
### Using This Action With a Mac Runner
172-
173-
Docker is not installed on Mac runners by default, and [installing it can be time consuming](https://github.com/actions/runner/issues/1456). As an alternative, we suggest breaking the build and upload for languages that require a Mac runner to build (like iOS) into separate jobs. An example workflow is below:
174-
175-
```yaml
176-
jobs:
177-
build:
178-
name: Build
179-
runs-on: macos-12
180-
181-
steps:
182-
- name: checkout
183-
uses: actions/checkout@v2
184-
185-
# SNIP: steps to build an iOS application
186-
187-
- uses: actions/upload-artifact@v3
188-
with:
189-
path: path/to/iOSApplication.zip
190-
scan:
191-
name: Scan
192-
runs-on: ubuntu-latest
193-
needs: build
194-
steps:
195-
- uses: actions/download-artifact@v3
196-
with:
197-
path: iOSApplication.zip
198-
199-
- name: Upload & Scan
200-
uses: veracode/veracode-uploadandscan-action@0.2.6
201-
with:
202-
appname: 'MyTestApp'
203-
filepath: 'iOSApplication.zip'
204-
vid: 'FakeID'
205-
vkey: 'FakeKey'
206-
```

action.yml

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -93,33 +93,5 @@ inputs:
9393
# time: # id of output
9494
# description: 'The time we greeted you'
9595
runs:
96-
using: 'docker'
97-
image: 'Dockerfile'
98-
args:
99-
- ${{ inputs.appname }}
100-
- ${{ inputs.createprofile }}
101-
- ${{ inputs.filepath }}
102-
- ${{ inputs.version }}
103-
- ${{ inputs.vid }}
104-
- ${{ inputs.vkey }}
105-
- ${{ inputs.createsandbox}}
106-
- ${{ inputs.sandboxname }}
107-
- ${{ inputs.scantimeout }}
108-
- ${{ inputs.exclude }}
109-
- ${{ inputs.include }}
110-
- ${{ inputs.criticality }}
111-
- ${{ inputs.pattern }}
112-
- ${{ inputs.replacement }}
113-
- ${{ inputs.sandboxid }}
114-
- ${{ inputs.scanallnonfataltoplevelmodules }}
115-
- ${{ inputs.selected }}
116-
- ${{ inputs.selectedpreviously }}
117-
- ${{ inputs.teams }}
118-
- ${{ inputs.toplevel }}
119-
- ${{ inputs.deleteincompletescan }}
120-
- ${{ inputs.scanpollinginterval }}
121-
- ${{ inputs.javawrapperversion }}
122-
- ${{ inputs.debug }}
123-
- ${{ inputs.includenewmodules }}
124-
- ${{ inputs.maxretrycount }}
125-
- ${{ inputs.policy }}
96+
using: 'node20'
97+
main: 'dist/index.js'

0 commit comments

Comments
 (0)