Skip to content

Commit

Permalink
test(ci/cd) testing main.yml with docker-scout for frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
Uj5Ghare authored Dec 11, 2024
1 parent 55116c6 commit 3b92b2c
Showing 1 changed file with 38 additions and 23 deletions.
61 changes: 38 additions & 23 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,34 +69,49 @@ jobs:
- name: Pushing Docker Image
run: docker push ${{ vars.DOCKER_USER }}/eng-frontend:1.${{ github.run_number }}.${{ github.run_attempt}}

# Image-Vuln-Check-Frontend:
# if: contains(github.event.head_commit.message, 'frontend')
# runs-on: ubuntu-24.04
# needs: [Build-And-Push-Frontend]
# continue-on-error: true
# defaults:
# run:
# shell: bash
# working-directory: frontend/
# steps:
# - name: Checkout Code
# uses: actions/checkout@v4
# - name: Run Trivy Vulnerability Scanner
# uses: aquasecurity/[email protected]
# with:
# image-ref: "docker.io/${{ vars.DOCKER_USER }}/eng-frontend:1.${{ github.run_number }}.${{ github.run_attempt}}"
# format: "table"
# exit-code: "1"
# ignore-unfixed: true
# output: trivy-report-frontend.txt
# vuln-type: "os,library"
# severity: "CRITICAL,HIGH"
# - name: Upload Artifact
# uses: actions/upload-artifact@v4
# with:
# name: trivy-report-frontend
# path: trivy-report-frontend.txt

Image-Vuln-Check-Frontend:
if: contains(github.event.head_commit.message, 'frontend')
runs-on: ubuntu-24.04
needs: [Build-And-Push-Frontend]
continue-on-error: true
defaults:
run:
shell: bash
working-directory: frontend/
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Run Trivy Vulnerability Scanner
uses: aquasecurity/[email protected]
with:
image-ref: "docker.io/${{ vars.DOCKER_USER }}/eng-frontend:1.${{ github.run_number }}.${{ github.run_attempt}}"
format: "table"
exit-code: "1"
ignore-unfixed: true
output: trivy-report-frontend.txt
vuln-type: "os,library"
severity: "CRITICAL,HIGH"
- name: Upload Artifact
uses: actions/upload-artifact@v4
- name: Docker Scout
id: docker-scout
uses: docker/scout-action@v1
with:
name: trivy-report-frontend
path: trivy-report-frontend.txt

command: cves,recommendations
image: docker.io/${{ vars.DOCKER_USER }}/eng-frontend:1.${{ github.run_number }}.${{ github.run_attempt}}
ignore-unchanged: true
only-severities: critical,high
write-comment: true
github-token: ${{ secrets.GITHUB_TOKEN }}

Update-ImgTag-Frontend:
runs-on: ubuntu-24.04
needs: [Image-Vuln-Check-Frontend]
Expand Down

0 comments on commit 3b92b2c

Please sign in to comment.