-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (47 loc) · 1.21 KB
/
linter.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
name: Linter
on:
push:
branches: [main]
paths-ignore:
[
"docs/**",
".vscode/**",
"**/*.md",
"**/ci-cd.yml",
"**/codeql-analysis.yml",
"**/mutation-tests.yml",
"**/test-results.yml",
]
pull_request:
paths-ignore:
[
"docs/**",
".vscode/**",
"**/*.md",
"**/ci-cd.yml",
"**/codeql-analysis.yml",
"**/mutation-tests.yml",
"**/test-results.yml",
]
workflow_dispatch:
jobs:
csharp:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET SDK
uses: actions/setup-dotnet@v3
with:
global-json-file: ./global.json
- name: Lint C# files with dotnet format
id: lint
run: dotnet format --severity error --verbosity diagnostic --report ./linter-report || true
- name: Save report
if: always()
uses: actions/upload-artifact@v3
with:
name: dotnet-format-report
path: ./linter-report/*
- name: Check for errors
if: ${{ steps.lint.outcome != 'success' }}
run: echo "::error::dotnet format found issues in the code. Please fix them."