File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change 1+ name : ' SecurityCodeScan'
2+ description : ' Security Code Scan action to add NuGet packages and set up projects'
3+ branding :
4+ icon : ' check-circle'
5+ color : ' purple'
6+ runs :
7+ using : " composite"
8+ steps :
9+ - name : Set up Security-Code-Scan
10+ shell : pwsh
11+ run : |
12+ $ErrorActionPreference = "Stop";
13+
14+ # $sdks = dotnet --list-sdks
15+ # $sdk = $sdks | Sort-Object -Descending | Select-Object -First 1
16+ # $sdkregex = [regex]::Match($sdk, "(\d\.\d\.\d\d\d) \[([^]]*)\]")
17+
18+ # $slndll = Join-Path $sdkregex.captures.groups[2].value $sdkregex.captures.groups[1].value "Microsoft.DotNet.Cli.Sln.Internal.dll"
19+ # Add-Type -path $slndll
20+
21+ foreach($project in Get-ChildItem -Path . -Filter *.csproj -Recurse -Force) {
22+ dotnet add $project package SecurityCodeScan.VS2019
23+ # $slnobj = [Microsoft.DotNet.Cli.Sln.Internal.SlnFile]::Read($sln)
24+ # filter by solution folder guid TypeGuid != {2150E333-8FDC-42A3-9474-1A3956D46DE8}
25+
26+ # foreach ($project in $slnobj.Projects) {
27+ # Write-Output $project.FilePath
28+ # }
29+ }
You can’t perform that action at this time.
0 commit comments