-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathaction.yml
More file actions
178 lines (175 loc) · 7.08 KB
/
action.yml
File metadata and controls
178 lines (175 loc) · 7.08 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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
name: JetBrains ReSharper Inspect Code
author: JetBrains, Inc
description: C# static analysis tool
inputs:
settings:
description: "Path to the file to use custom settings from (default: Use R#'s solution shared settings if exists)"
output:
description: Write inspections report to specified file
default: "results.sarif.json"
format:
description: Write inspections report in specified format [Xml, Html, Text, Sarif]
default: "Sarif"
jobs:
description: Run up to N jobs in parallel. 0 means as many as possible
default: "0"
absolute-paths:
description: Use absolute paths in inspections report
default: "False"
no-swea:
description: Force disable solution-wide analysis
default: "False"
swea:
description: Force enable solution-wide analysis
default: "False"
project:
description: 'Analyze only projects selected by provided wildcards (default: analyze all projects in solution)'
include:
description: 'Analyze only files selected by provided wildcards (default: analyze all files in solution)'
exclude:
description: 'Exclude files selected by provided wildcards from analysis (default: analyze all files in solution)'
dumpIssuesTypes:
description: Dump issues types
default: "False"
sEverity:
description: Minimal severity level to report [INFO, HINT, SUGGESTION, WARNING, ERROR]
default: "SUGGESTION"
debug:
description: Show debugging messages
default: "False"
verbosity:
description: Display this amount of information [OFF, FATAL, ERROR, WARN, INFO, VERBOSE, TRACE]
default: "INFO"
help:
description: Show help and exit
version:
description: Show tool version and exit
toolset:
description: 'MsBuild toolset version. Highest available is used by default. Example: --toolset=12.0'
toolset-path:
description: 'MsBuild toolset (exe/dll) path. Example: --toolset-path=/usr/local/msbuild/bin/current/MSBuild.exe'
mono:
description: 'Mono path. Empty to ignore Mono. Not specified for autodetect. Example: --mono=/Library/Frameworks/Mono.framework/Versions/Current/bin/mono'
dotnetcore:
description: '.NET Core path. Empty to ignore .NET Core. Not specified for autodetect. Example: --dotnetcore=/usr/local/share/dotnet/dotnet'
dotnetcoresdk:
description: '.NET Core SDK version. Example: --dotnetcoresdk=8.0.100'
disable-settings-layers:
description: 'Disable specified settings layers. Possible values: GlobalAll, GlobalPerProduct, SolutionShared, SolutionPersonal, ProjectShared, ProjectPersonal'
no-buildin-settings:
description: Suppress global, solution and project settings profile usage. Alias for --disable-settings-layers:GlobalAll;GlobalPerProduct;SolutionShared;SolutionPersonal;ProjectShared;ProjectPersonal
default: "False"
caches-home:
description: Path to the directory where produced caches will be stored
properties:
description: MSBuild properties
targets-for-references:
description: MSBuild targets. These targets will be executed to get referenced assemblies of projects.
targets-for-items:
description: MSBuild targets. These targets will be executed to get other items (e.g. Compile item) of projects.
eXtensions:
description: Install and use specified extensions
source:
description: Install extensions from specified source(s)
measure:
description: Measure own tool's performance [MEMORY, SAMPLING, TIMELINE]
no-build:
description: Do not build solution before processing
default: "False"
build:
description: Build solution before processing
default: "True"
target:
description: MsBuild target to execute before processing.
default: "Build"
solution:
description: Solution file
tool-version:
description: Tool Version
default: "2026.1.0.1"
dotnet-version:
description: .NET SDK version used to install and run ReSharper command line tools
default: "10.x"
outputs:
report-file:
description: Path to the generated inspection report file
value: ${{ steps.inspectcode.outputs.report-file }}
report-format:
description: Output format used for the inspection report
value: ${{ steps.inspectcode.outputs.report-format }}
runs:
using: composite
steps:
- name: Setup .NET
uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 # v5
with:
dotnet-version: ${{ inputs.dotnet-version }}
- name: Install ReSharper command line tools
shell: bash
run: dotnet tool install JetBrains.ReSharper.GlobalTools --global --version ${{ inputs.tool-version }}
- name: Inspect code with ReSharper
id: inspectcode
shell: pwsh
env:
INPUT_settings: ${{ inputs.settings }}
INPUT_output: ${{ inputs.output }}
INPUT_format: ${{ inputs.format }}
INPUT_jobs: ${{ inputs.jobs }}
INPUT_absolute-paths: ${{ inputs.absolute-paths }}
INPUT_no-swea: ${{ inputs.no-swea }}
INPUT_swea: ${{ inputs.swea }}
INPUT_project: ${{ inputs.project }}
INPUT_include: ${{ inputs.include }}
INPUT_exclude: ${{ inputs.exclude }}
INPUT_dumpIssuesTypes: ${{ inputs.dumpIssuesTypes }}
INPUT_sEverity: ${{ inputs.sEverity }}
INPUT_debug: ${{ inputs.debug }}
INPUT_verbosity: ${{ inputs.verbosity }}
INPUT_help: ${{ inputs.help }}
INPUT_version: ${{ inputs.version }}
INPUT_toolset: ${{ inputs.toolset }}
INPUT_toolset-path: ${{ inputs.toolset-path }}
INPUT_mono: ${{ inputs.mono }}
INPUT_dotnetcore: ${{ inputs.dotnetcore }}
INPUT_dotnetcoresdk: ${{ inputs.dotnetcoresdk }}
INPUT_disable-settings-layers: ${{ inputs.disable-settings-layers }}
INPUT_no-buildin-settings: ${{ inputs.no-buildin-settings }}
INPUT_caches-home: ${{ inputs.caches-home }}
INPUT_properties: ${{ inputs.properties }}
INPUT_targets-for-references: ${{ inputs.targets-for-references }}
INPUT_targets-for-items: ${{ inputs.targets-for-items }}
INPUT_eXtensions: ${{ inputs.eXtensions }}
INPUT_source: ${{ inputs.source }}
INPUT_measure: ${{ inputs.measure }}
INPUT_no-build: ${{ inputs.no-build }}
INPUT_build: ${{ inputs.build }}
INPUT_target: ${{ inputs.target }}
INPUT_solution: ${{ inputs.solution }}
run: |-
$arguments = @()
$positionalInputs = @("solution")
Get-ChildItem env:INPUT_* | Where-Object Value | ForEach-Object {
$optionName = $_.Name -replace "^INPUT_"
if ($optionName -notin $positionalInputs) {
$arguments += "--$optionName=$($_.Value)"
}
}
if ($env:INPUT_solution) {
& jb inspectcode "$env:INPUT_solution" @arguments
} else {
& jb inspectcode @arguments
}
if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}
"report-file=${{ inputs.output }}" >> $env:GITHUB_OUTPUT
"report-format=${{ inputs.format }}" >> $env:GITHUB_OUTPUT
- name: Upload SARIF file
if: inputs.format == 'Sarif'
uses: github/codeql-action/upload-sarif@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4
with:
sarif_file: ${{ inputs.output }}
category: resharper-inspectcode
branding:
color: gray-dark
icon: Hash