|
7 | 7 | - 'dependabot/**'
|
8 | 8 | pull_request:
|
9 | 9 | schedule:
|
10 |
| - - cron: '0 8 * * *' |
| 10 | + - cron: '0 8 * * 1' |
11 | 11 | workflow_dispatch:
|
12 | 12 |
|
13 | 13 | jobs:
|
14 | 14 | analyze:
|
15 | 15 | name: Analyze
|
16 | 16 | runs-on: ubuntu-latest
|
| 17 | + permissions: |
| 18 | + actions: read |
| 19 | + contents: read |
| 20 | + security-events: write |
| 21 | + |
17 | 22 | steps:
|
18 |
| - - name: Checkout repository |
19 |
| - uses: actions/checkout@v2 |
20 |
| - |
21 |
| - - name: Initialize CodeQL |
22 |
| - uses: github/codeql-action/init@v1 |
23 |
| - with: |
24 |
| - queries: security-and-quality |
25 |
| - languages: csharp |
26 |
| - |
27 |
| - - name: Build solution |
28 |
| - shell: pwsh |
29 |
| - run: | |
30 |
| - $buildConfiguration = "Release" |
31 |
| - $useSharedCompilation = "false" |
32 |
| -
|
33 |
| - Get-ChildItem src -Include *.csproj -Recurse | ForEach-Object { |
34 |
| - dotnet build $_.FullName ` |
35 |
| - -property:UseSharedCompilation=$useSharedCompilation ` |
36 |
| - --configuration $buildConfiguration ` |
37 |
| - --no-incremental |
38 |
| - } |
39 |
| -
|
40 |
| - - name: Perform CodeQL Analysis |
41 |
| - uses: github/codeql-action/analyze@v1 |
| 23 | + - name: Checkout repository |
| 24 | + uses: actions/checkout@v2 |
| 25 | + |
| 26 | + - name: Initialize CodeQL |
| 27 | + uses: github/codeql-action/init@v1 |
| 28 | + with: |
| 29 | + queries: security-and-quality |
| 30 | + languages: csharp |
| 31 | + |
| 32 | + - name: Build solution |
| 33 | + shell: pwsh |
| 34 | + run: | |
| 35 | + $start = (Get-Location).Path.Length + 1 |
| 36 | + $sln = Join-Path '..' 'ApiVersioning.sln' |
| 37 | + $projects = Get-ChildItem src -Include *.csproj -Recurse | ` |
| 38 | + ForEach-Object { $_.FullName.Substring($start) } |
| 39 | + $json = ConvertTo-Json(New-Object PSObject -Property @{solution=@{path=$sln;projects=$projects}}) |
| 40 | + $obj = New-Item -Path 'obj' -ItemType Directory -Force |
| 41 | + $slnf = New-Item -Path (Join-Path $obj 'codeql.slnf') -ItemType File -Value $json -Force |
| 42 | +
|
| 43 | + dotnet build $slnf.FullName --configuration Release |
| 44 | +
|
| 45 | + - name: Perform CodeQL Analysis |
| 46 | + uses: github/codeql-action/analyze@v1 |
42 | 47 |
|
43 | 48 | # Built with ❤ by [Pipeline Foundation](https://pipeline.foundation)
|
0 commit comments