-
Notifications
You must be signed in to change notification settings - Fork 1
67 lines (67 loc) · 2.01 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Full Build
on:
workflow_dispatch:
push:
branches: [ "main" ]
pull_request:
types: [opened, synchronize, reopened]
jobs:
build:
name: Build and analyze
# container: oraclelinux:8
runs-on: ubuntu-latest
steps:
# - name: Install prereqs
# run: |
# dnf install -y \
# jq \
# git \
# tar \
# libicu \
# curl
- name: Set up .Net 8
uses: actions/[email protected]
with:
dotnet-version: '8.0.200'
- uses: actions/setup-node@v4
with:
node-version: 18
architecture: 'x64'
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
shell: bash
run: |
dotnet msbuild -restore ./InsecureProject.sln
dotnet build ./InsecureProject.sln -m:1
- name: Snyk Test
uses: snyk/actions/dotnet@master
continue-on-error: true
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
command: test
args: --sarif-file-output=snyk-test.sarif --all-projects --detection-depth=5
- name: Upload Snyk Test to GitHub Code Scanning
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: snyk-test.sarif
- name: Snyk Code Test
uses: snyk/actions/dotnet@master
continue-on-error: true
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
command: code test
args: --sarif-file-output=snyk-code-test.sarif --all-projects --detection-depth=5
- name: Upload Snyk Code Test to GitHub Code Scanning
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: snyk-code-test.sarif
permissions:
pull-requests: write
contents: write
security-events: write