42 lines
1.0 KiB
YAML
42 lines
1.0 KiB
YAML
name: Scan Vulnerabilities
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
schedule:
|
|
- cron: "0 2 * * 1" # At 02:00 on Monday
|
|
push:
|
|
branches: [main]
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
sbom-upload:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
|
|
- name: Generate SBOM using Anchore (CycloneDX)
|
|
uses: anchore/sbom-action@v0
|
|
with:
|
|
format: cyclonedx-json
|
|
output-file: sbom.json
|
|
upload-artifact: false
|
|
|
|
- name: Read API key from the runner
|
|
uses: https://git.sothink.vn/gitea/global-workflow/.gitea/actions/load-env@main
|
|
with:
|
|
names: DT_API_KEY
|
|
|
|
- name: Upload SBOM to Dependency-Track
|
|
uses: DependencyTrack/gh-upload-sbom@v4
|
|
with:
|
|
server-hostname: "${{ vars.DT_HOSTNAME }}"
|
|
api-key: ${{ env.DT_API_KEY }}
|
|
project-name: "${{ github.repository }}"
|
|
project-version: "latest"
|
|
bom-filename: "sbom.json"
|
|
auto-create: true
|