Skip to content

Commit 81ebb59

Browse files
authored
Create action.yml
1 parent 57d7763 commit 81ebb59

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

action.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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+
}

0 commit comments

Comments
 (0)