Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .github/workflows/03-build-containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: "Nível 3: Containers e Segurança"
on:
pull_request:
types: [closed]
branches: [desafio-nivel-3]
branches: [ desafio-nivel-3 ]

permissions:
contents: read
Expand All @@ -12,7 +12,7 @@ permissions:
env:
CHALLENGE_LEVEL: 3
CHALLENGE_NAME: "containers-e-seguranca"
REGISTRY: ghcr.iodesafio-nivel-3
REGISTRY: ghcr.io

jobs:
build-scan-and-push:
Expand All @@ -21,8 +21,6 @@ jobs:
runs-on: ubuntu-latest

steps:
# AQUI VAI O CÓDIGO DO DESAFIO :)

- name: Checkout repository
uses: actions/checkout@v3

Expand All @@ -39,6 +37,7 @@ jobs:
if grep -qE "DL3006|DL3008" lint-report.txt; then
echo "Linting failed due to DL3006 or DL3008." && exit 1;
fi

- name: Upload lint report
uses: actions/upload-artifact@v3
with:
Expand All @@ -59,13 +58,14 @@ jobs:
context: .
file: ./Dockerfile
push: false
tags: ghcr.io/${{ github.repository_owner }}/${{ vars.IMAGE_NAME }}:${{ github.sha }}
tags: ghcr.io/${{ github.repository_owner }}/my-app:${{ github.sha }}

- name: Scan Docker image for vulnerabilities with Trivy
id: scan-image
uses: aquasecurity/trivy-action@0.28.0
with:
image-ref: ghcr.io/${{ github.repository_owner }}/${{ vars.IMAGE_NAME }}:${{ github.sha }}
image-ref: ghcr.io/${{ github.repository_owner }}/my-app:${{ github.sha }}

format: table
output: trivy-report.txt

Expand Down Expand Up @@ -126,4 +126,4 @@ jobs:
with:
name: level-3-certificate
path: certificates/
retention-days: 30
retention-days: 30