Skip to content

Commit

Permalink
add Zap Scan and Sonar
Browse files Browse the repository at this point in the history
  • Loading branch information
aldudin committed Apr 16, 2024
1 parent 7955414 commit 586906b
Showing 1 changed file with 26 additions and 8 deletions.
34 changes: 26 additions & 8 deletions .github/workflows/deploy-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_dispatch:
push:
branches:
- main
- aldudinn
paths-ignore:
- database/**
- package.json
Expand Down Expand Up @@ -89,12 +89,12 @@ jobs:
ng test --watch=false --progress=false --browsers=ChromeHeadless --code-coverage --source-map=false
continue-on-error: true

# # SonarQube integration frontend
# - name: SonarQube Scan
# uses: sonarsource/sonarcloud-github-action@v2
# env:
# SONAR_HOST_URL: https://sonarcloud.io
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_TEST }}
# SonarQube integration frontend
- name: SonarQube Scan
uses: sonarsource/sonarcloud-github-action@v2
env:
SONAR_HOST_URL: https://sonarcloud.io
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_TEST }}

docker-build-backend:
needs: [build-backend]
Expand Down Expand Up @@ -179,4 +179,22 @@ jobs:
ENV_NAME=dev \
IMAGE_TAG_FRONTEND=latest \
IMAGE_TAG_BACKEND=latest \
working-directory: ./helm/main
working-directory: ./helm/main

scan:
steps:
- name: Run ZAP Scan
uses: zaproxy/[email protected]
with:
target: 'https://dev-strdata.apps.advsol-ams.3j6z.p1.openshiftapps.com/'
env:
TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Fail build on any alerts
run: |
if grep -q "FAIL-NEW: 0" zap.out; then
echo "No new alerts found"
else
echo "New alerts found, failing build"
exit 1
fi

0 comments on commit 586906b

Please sign in to comment.