on: [push]

name: Datadog Software Composition Analysis
permissions:
  contents: read

jobs:
  software-composition-analysis:
    runs-on: ubuntu-latest
    name: Datadog SBOM Generation and Upload
    steps:
    - name: Checkout
      uses: actions/checkout@v4
    - name: Check imported libraries are secure and compliant
      id: datadog-software-composition-analysis
      uses: DataDog/datadog-sca-github-action@main
      with:
        dd_api_key: "${{ secrets.DD_API_KEY }}"
        dd_app_key: "${{ secrets.DD_APP_KEY }}"
        dd_site: datadoghq.com
    continue-on-error: true
  static-analysis:
    runs-on: ubuntu-latest
    name: Datadog Static Analyzer
    steps:
    - name: Checkout
      uses: actions/checkout@v4
    - name: Check code meets quality and security standards
      id: datadog-static-analysis
      uses: DataDog/datadog-static-analyzer-github-action@v1
      with:
        dd_api_key: ${{ secrets.DD_API_KEY }}
        dd_app_key: ${{ secrets.DD_APP_KEY }}
        dd_site: datadoghq.com
        secrets_enabled: false
        static_analysis_enabled: true
        cpu_count: 2
    continue-on-error: true