File tree Expand file tree Collapse file tree 2 files changed +58
-0
lines changed Expand file tree Collapse file tree 2 files changed +58
-0
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,8 @@ inputs:
17
17
18
18
## Usage
19
19
20
+ ### Linux
21
+
20
22
` ` ` yaml
21
23
name : SAST
22
24
on :
47
49
api_url : ${{ vars.COVERITY_ON_POLARIS_API_URL }}
48
50
access_token : ${{ secrets.COVERITY_ON_POLARIS_ACCESS_TOKEN }}
49
51
` ` `
52
+
53
+ ### Windows
54
+
55
+ ` ` ` yaml
56
+ name : SAST
57
+ on :
58
+ workflow_dispatch :
59
+ workflow_call :
60
+ schedule :
61
+ - cron : " 0 12 * * *" # Runs at 12:00 everyday
62
+
63
+ env :
64
+ DOTNET_NOLOGO : 1
65
+ DOTNET_CLI_TELEMETRY_OPTOUT : 1
66
+
67
+ jobs :
68
+ analyze :
69
+ name : Capture and send
70
+ runs-on : windows-latest
71
+ steps :
72
+ - name : Checkout repo
73
+ uses : actions/checkout@v3
74
+
75
+ - name : Setup MSBuild.exe
76
+
77
+
78
+ - name : Install dependencies
79
+ run : dotnet restore
80
+
81
+ - name : Static application security testing
82
+ uses : visma-prodsec/coverity-on-polaris-workflow@v1
83
+ with :
84
+ api_url : ${{ vars.COVERITY_ON_POLARIS_API_URL }}
85
+ access_token : ${{ secrets.COVERITY_ON_POLARIS_ACCESS_TOKEN }}
86
+ ` ` `
Original file line number Diff line number Diff line change 33
33
echo Removing Polaris CLI
34
34
rm -rf /tmp/polari_cli
35
35
36
+ - if : runner.os == 'Windows'
37
+ shell : pwsh
38
+ env :
39
+ DOTNET_NOLOGO : 1
40
+ DOTNET_CLI_TELEMETRY_OPTOUT : 1
41
+ POLARIS_ACCESS_TOKEN : ${{ inputs.access_token }}
42
+ run : |
43
+ Write-Host "Downloading Polaris CLI"
44
+ $polarisCliZipPath = Join-Path $env:TEMP "polaris_cli-win64.zip"
45
+ Invoke-WebRequest -Uri "${{ inputs.api_url }}/api/tools/v2/downloads/polaris_cli-win64.zip" -OutFile $polarisCliZipPath
46
+
47
+ Write-Host "Unzipping Polaris CLI"
48
+ $polarisCliUnzipPath = Join-Path $env:TEMP "polaris_cli"
49
+ Expand-Archive -Path $polarisCliZipPath -DestinationPath $polarisCliUnzipPath
50
+
51
+ Write-Host "Running Polaris Analysis"
52
+ & (Get-ChildItem -Path $polarisCliUnzipPath -Recurse -Filter polaris.exe | Select-Object -First 1).FullName analyze --upload-local-config
53
+
54
+ Write-Host "Removing Polaris CLI"
55
+ Remove-Item -Recurse -Force $polarisCliUnzipPath
56
+
36
57
branding :
37
58
icon : ' shield'
38
59
color : ' purple'
You can’t perform that action at this time.
0 commit comments