Merge branch 'UAT-44' of github.com:udx/udx-worker into UAT-44 #158
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Test Docker Image | |
on: | |
push: | |
branches-ignore: | |
- latest | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Run Development Pipeline | |
run: make dev-pipeline | |
working-directory: . | |
- name: Cache Trivy DB | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/trivy | |
key: ${{ runner.os }}-trivy-db | |
restore-keys: | | |
${{ runner.os }}-trivy-db | |
- name: Install Trivy | |
run: | | |
curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sudo sh -s -- -b /usr/local/bin | |
- name: Trivy Scanning | |
run: | | |
trivy image --severity HIGH,CRITICAL --exit-code 0 --quiet --retry 3 udx-worker/udx-worker:latest | tee trivy.log | grep -v 'INFO' | |
if grep -E "Total: [1-9]" trivy.log; then | |
echo "HIGH or CRITICAL vulnerabilities detected!" | |
exit 1 | |
else | |
echo "No HIGH or CRITICAL vulnerabilities found." | |
fi |