mirror of
https://github.com/RayLabsHQ/gitea-mirror.git
synced 2026-10-28 09:11:55 +01:00
76 lines
1.8 KiB
YAML
76 lines
1.8 KiB
YAML
name: Docker Security Scan
|
|
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
paths:
|
|
- 'Dockerfile'
|
|
- '.dockerignore'
|
|
- 'package.json'
|
|
- 'bun.lock*'
|
|
pull_request:
|
|
branches: [ main ]
|
|
paths:
|
|
- 'Dockerfile'
|
|
- '.dockerignore'
|
|
- 'package.json'
|
|
- 'bun.lock*'
|
|
schedule:
|
|
- cron: '0 0 * * 0' # Run weekly on Sunday at midnight
|
|
|
|
permissions:
|
|
contents: read
|
|
actions: read
|
|
security-events: write
|
|
pull-requests: write # Required for Docker Scout PR comments
|
|
|
|
jobs:
|
|
scan:
|
|
name: Scan Docker Image
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
with:
|
|
driver-opts: network=host
|
|
|
|
- name: Build Docker image
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: .
|
|
push: false
|
|
load: true
|
|
tags: gitea-mirror:scan
|
|
# Disable GitHub Actions cache for this workflow
|
|
no-cache: true
|
|
|
|
- name: Docker Scout vulnerability scan
|
|
uses: docker/scout-action@v1.18.1
|
|
with:
|
|
command: cves
|
|
image: gitea-mirror:scan
|
|
sarif-file: scout-results.sarif
|
|
summary: true
|
|
exit-code: true
|
|
only-severities: critical,high
|
|
write-comment: true
|
|
|
|
- name: Upload Docker Scout scan results to GitHub Security tab
|
|
uses: github/codeql-action/upload-sarif@v3
|
|
if: always()
|
|
with:
|
|
sarif_file: scout-results.sarif
|
|
|
|
- name: Docker Scout policy evaluation
|
|
uses: docker/scout-action@v1.18.1
|
|
if: always()
|
|
with:
|
|
command: policy
|
|
image: gitea-mirror:scan
|
|
exit-code: false
|
|
write-comment: true
|