Skip to content

Commit 5b57195

Browse files
committed
update CI workflow permissions and add CVE analysis steps; enhance .dockerignore for compose files
1 parent 837a546 commit 5b57195

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

.github/workflows/ci.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ jobs:
1717
ci:
1818

1919
runs-on: ubuntu-latest
20+
permissions:
21+
contents: read # Ler o conteúdo do repositório
22+
packages: write # Permitir publicar pacotes no GitHub Packages
23+
pull-requests: write # Permitir criar e atualizar pull requests
24+
security-events: write # Enviar eventos de segurança para o Github Security
2025

2126
steps:
2227
- name: Checkout repository
@@ -67,3 +72,30 @@ jobs:
6772
secrets: |
6873
github_token=${{ secrets.MY_GITHUB_TOKEN }}
6974
75+
- name: Analyze for critical and high CVEs
76+
id: docker-scout-cves
77+
uses: docker/scout-action@v1
78+
with:
79+
command: cves
80+
image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.SHA }}
81+
only-severities: critical,high
82+
only-fixed: true
83+
summary: true # publicar github actions e pull request
84+
exit-code: true
85+
86+
- name: Analyze for all CVEs
87+
id: docker-scout-all-cves
88+
uses: docker/scout-action@v1
89+
with:
90+
command: cves
91+
image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.SHA }}
92+
summary: true
93+
sarif-file: sarif.output.json
94+
95+
- name: Upload SARIF result
96+
id: upload-sarif
97+
if: ${{ github.event_name != 'pull_request' }}
98+
uses: github/codeql-action/upload-sarif@v3
99+
with:
100+
sarif_file: sarif.output.json
101+

src/ci/nestjs-project/.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
**/*.jfm
2323
**/charts
2424
**/docker-compose*
25+
**/compose.*yml
26+
**/compose.*yaml
2527
**/compose.y*ml
2628
**/Dockerfile*
2729
**/node_modules

0 commit comments

Comments
 (0)