Skip to content

Commit

Permalink
feat: snyk pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
DevRico003 committed Feb 28, 2024
1 parent 8dbdb03 commit ab5b593
Showing 1 changed file with 5 additions and 23 deletions.
28 changes: 5 additions & 23 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,10 @@ jobs:
uses: actions/setup-node@v2
with:
node-version: '18'
- name: Check for package-lock.json
id: lockfile
run: |
if [[ -f package-lock.json ]]; then
echo "::set-output name=exists::true"
else
echo "::set-output name=exists::false"
fi

- name: Install dependencies
run: |
if [[ "${{ steps.lockfile.outputs.exists }}" == "true" ]]; then
npm ci
else
npm install
fi
run: npm ci

- name: Build
run: npm run build

Expand All @@ -47,23 +35,17 @@ jobs:
- name: Run tests
run: npm test

security:
security_and_notify:
needs: test
runs-on: ubuntu-latest
steps:
- name: Run Snyk to check for vulnerabilities
uses: snyk/actions/[email protected]
with:
args: --severity-threshold=high
fail-on-issues: true # This will make the workflow fail if issues are found

notify:
needs: security
runs-on: ubuntu-latest
environment: Production
if: failure() # This job will only run if the previous job fails
steps:
fail-on-issues: true
- name: Send failure notification
if: failure()
uses: dawidd6/action-send-mail@v3
with:
server_address: smtp.gmail.com
Expand Down

0 comments on commit ab5b593

Please sign in to comment.