fix: remove NuGet cache and locked-mode from CI workflow #3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: security | ||
| on: | ||
| push: | ||
| branches: [ main ] | ||
| pull_request: | ||
| branches: [ main ] | ||
| schedule: | ||
| - cron: '17 3 * * 1' | ||
| permissions: | ||
| contents: read | ||
| security-events: write | ||
| jobs: | ||
| codeql: | ||
| name: CodeQL analyze | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 45 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Setup .NET 8 | ||
| uses: actions/setup-dotnet@v5 | ||
| with: | ||
| dotnet-version: '8.0.x' | ||
| - name: Initialize CodeQL (C# + JS/TS) | ||
| uses: github/codeql-action/init@v4 | ||
| with: | ||
| languages: csharp,javascript-typescript | ||
| build-mode: autobuild | ||
| - name: Autobuild (C#) | ||
| uses: github/codeql-action/autobuild@v4 | ||
| - name: Analyze | ||
| uses: github/codeql-action/analyze@v4 | ||
| with: | ||
| category: "/language:multi" | ||
| trivy-fs: | ||
| name: Trivy (repo scan → SARIF) | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Trivy repo scan (fs) | ||
| uses: aquasecurity/[email protected] | ||
| with: | ||
| scan-type: 'fs' | ||
| scan-ref: '.' | ||
| format: 'sarif' | ||
| output: 'trivy-fs.sarif' | ||
| ignore-unfixed: true | ||
| severity: 'CRITICAL,HIGH,MEDIUM' | ||
| - name: Upload SARIF to Code Scanning | ||
| uses: github/codeql-action/upload-sarif@v4 | ||
| with: | ||
| sarif_file: trivy-fs.sarif | ||
| trivy-image: | ||
| name: Trivy (container image → SARIF) | ||
| runs-on: ubuntu-latest | ||
| if: ${{ hashFiles('**/Dockerfile') != '' }} | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Build API image (if Dockerfile present) | ||
| run: | | ||
| docker build -t app2-api:ci -f src/App2.Api/Dockerfile . | ||
| - name: Trivy image scan | ||
| uses: aquasecurity/[email protected] | ||
| with: | ||
| scan-type: 'image' | ||
| image-ref: 'app2-api:ci' | ||
| format: 'sarif' | ||
| output: 'trivy-image.sarif' | ||
| ignore-unfixed: true | ||
| severity: 'CRITICAL,HIGH' | ||
| - name: Upload SARIF to Code Scanning | ||
| uses: github/codeql-action/upload-sarif@v4 | ||
| with: | ||
| sarif_file: trivy-image.sarif | ||