Skip to content

Add initial GitHub Actions workflow for testing Node.js application #7

Add initial GitHub Actions workflow for testing Node.js application

Add initial GitHub Actions workflow for testing Node.js application #7

Workflow file for this run

name: Test App
on:
pull_request:
types: [opened, reopened, synchronize]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout the code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18
- name: Install dependencies
run: npm install
- name: Run tests
run: npm test
- name: Build app
run: docker build -t test-app .
- name: Scan Docker image with Trivy
uses: aquasecurity/trivy-action@0.28.0
with:
image-ref: 'test-app'
format: 'table'
exit-code: '1'
ignore-unfixed: true
vuln-type: 'os,library'
severity: 'CRITICAL,HIGH'