Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

Commit

Permalink
Merge branch 'master' into dependabot/pip/django-cors-headers-4.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
c0rydoras authored Apr 12, 2024
2 parents cb61011 + f37e8e4 commit 4cb9457
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ jobs:
org.opencontainers.image.licenses=${{ github.event.repository.license.spdx_id }}
- name: Login to GHCR
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
id: docker_build_ghcr
uses: docker/build-push-action@v2
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/schedule.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
name: Schedule

on:
schedule:
- cron: 11 15 * * *
workflow_dispatch:

jobs:
scan-backend:
name: Scan backend image
uses: ./.github/workflows/trivy-scan.yaml
with:
image-ref: ghcr.io/adfinis/timed-backend
48 changes: 48 additions & 0 deletions .github/workflows/trivy-scan.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
name: Trivy Scan

on:
workflow_call:
inputs:
image-ref:
required: true
type: string
description: The image to scan e.g. ghcr.io/owner/image

jobs:
trivy-scan:
permissions:
actions: none
checks: none
contents: none
deployments: none
issues: none
packages: write
pull-requests: none
repository-projects: none
security-events: write
statuses: none
id-token: none

runs-on: ubuntu-latest
name: Scan ${{ inputs.image-ref }}
steps:
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Run Trivy vulnerability scanner
uses: aquasecurity/[email protected]
with:
image-ref: ${{ inputs.image-ref }}
format: "sarif"
output: "trivy.sarif"

- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v3
if: always()
with:
sarif_file: "trivy.sarif"

0 comments on commit 4cb9457

Please sign in to comment.