Bump Steeltoe version #508
Workflow file for this run
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: Scan vulnerable dependencies | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - '3.x' | |
| pull_request: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| env: | |
| DOTNET_CLI_TELEMETRY_OPTOUT: 1 | |
| DOTNET_NOLOGO: true | |
| SOLUTION_FILE: 'src/Steeltoe.All.sln' | |
| jobs: | |
| scan: | |
| name: Scan | |
| timeout-minutes: 15 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: | | |
| 8.0.* | |
| 10.0.* | |
| - name: Git checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| persist-credentials: false | |
| - name: Report vulnerable dependencies | |
| shell: pwsh | |
| run: | | |
| $ErrorActionPreference = 'Stop' | |
| $PSNativeCommandUseErrorActionPreference = $true | |
| $output = dotnet list ${{ env.SOLUTION_FILE }} package --vulnerable --include-transitive --format json --output-version 1 2>&1 | |
| $text = ($output | Out-String).TrimEnd() | |
| $json = $text | ConvertFrom-Json | |
| $hasVulnerabilities = $false | |
| foreach ($project in $json.projects) { | |
| if (-not $project.frameworks) { | |
| continue | |
| } | |
| $isTestProject = $project.path -like '*/test/*' | |
| foreach ($framework in $project.frameworks) { | |
| foreach ($package in $framework.topLevelPackages) { | |
| $hasVulnerabilities = $true | |
| foreach ($vulnerability in $package.vulnerabilities) { | |
| Write-Host "$($project.path) ($($framework.framework)): top-level $($package.id) $($package.resolvedVersion) – $($vulnerability.severity): $($vulnerability.advisoryurl)" | |
| } | |
| } | |
| if (-not $isTestProject) { | |
| foreach ($package in $framework.transitivePackages) { | |
| $hasVulnerabilities = $true | |
| foreach ($vulnerability in $package.vulnerabilities) { | |
| Write-Host "$($project.path) ($($framework.framework)): transitive $($package.id) $($package.resolvedVersion) – $($vulnerability.severity): $($vulnerability.advisoryurl)" | |
| } | |
| } | |
| } | |
| } | |
| } | |
| if ($hasVulnerabilities) { | |
| exit 1 | |
| } |