Repository navigation
109 lines (92 loc) · 2.94 KB
/
Copy pathcodeql.yml
File metadata and controls
109 lines (92 loc) · 2.94 KB
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: "AEGS: CodeQL Security Analysis"
on:
workflow_dispatch:
push:
branches:
- master
- main
pull_request:
branches: [master, main]
schedule:
- cron: "0 6 * * 1" # Run every Monday at 6am UTC
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# Each job declares the token scopes it needs.
permissions: {}
env:
DOTNET_VERSION: "10.0.x"
DOTNET_CLI_TELEMETRY_OPTOUT: "1"
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: "1"
DOTNET_NOLOGO: "true"
SOLUTION_PATH: ./src/AzureEventGridSimulator.slnx
jobs:
codeql:
name: "AEGS: CodeQL"
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: read
security-events: write
actions: read
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Setup .NET
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Initialize CodeQL
uses: github/codeql-action/init@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4.39.1
with:
languages: csharp
queries: security-and-quality
config: |
query-filters:
- include:
problem.severity:
- error
- warning
- name: Build
run: dotnet build ${{ env.SOLUTION_PATH }} --configuration Release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4.39.1
with:
category: "/language:csharp"
dockerfile:
name: "AEGS: Hadolint"
runs-on: ubuntu-latest
timeout-minutes: 10
# security-events write uploads the SARIF results
permissions:
contents: read
security-events: write
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Lint Dockerfile
uses: hadolint/hadolint-action@06be81baf89a55ffd0e24b8f04a4185738dd3387 # v3.5.0
with:
dockerfile: docker/Dockerfile
failure-threshold: warning
format: sarif
output-file: hadolint-results.sarif
- name: Upload Hadolint results to GitHub Security
uses: github/codeql-action/upload-sarif@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4.39.1
if: always()
with:
sarif_file: hadolint-results.sarif
category: dockerfile
actions:
name: "AEGS: Actionlint"
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Run actionlint
uses: raven-actions/actionlint@3d39aea434753780c3b3d4a1a31c854b4dbf49d7 # v2.2.0
with:
fail-on-error: true