Skip to content

Commit 3bf0bee

Browse files
authored
Update action.yml
1 parent 9ec5708 commit 3bf0bee

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

action.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,26 @@ runs:
1313
1414
foreach($project in Get-ChildItem -Path . -Filter *.csproj -Recurse -Force) {
1515
dotnet add $project package SecurityCodeScan.VS2019
16+
17+
$xml = [xml](Get-Content -Path $project)
18+
19+
$errorLog = $xml.CreateElement("ErrorLog")
20+
$errorLog.set_InnerText("analysis.sarif")
21+
$propertyGroups = $xml.SelectNodes("//Project/PropertyGroup")
22+
$propertyGroups[0].AppendChild($errorLog)
23+
24+
$xml.Save($project)
25+
}
26+
27+
foreach($project in Get-ChildItem -Path . -Filter *.vbproj -Recurse -Force) {
28+
dotnet add $project package SecurityCodeScan.VS2019
29+
30+
$xml = [xml](Get-Content -Path $project)
31+
32+
$errorLog = $xml.CreateElement("ErrorLog")
33+
$errorLog.set_InnerText("analysis.sarif")
34+
$propertyGroups = $xml.SelectNodes("//Project/PropertyGroup")
35+
$propertyGroups[0].AppendChild($errorLog)
36+
37+
$xml.Save($project)
1638
}

0 commit comments

Comments
 (0)