-
-
Notifications
You must be signed in to change notification settings - Fork 23
/
CodeqlActionInitV2.kt
286 lines (280 loc) · 13.3 KB
/
CodeqlActionInitV2.kt
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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
// This file was generated using action-binding-generator. Don't change it by hand, otherwise your
// changes will be overwritten with the next binding code regeneration.
// See https://github.com/typesafegithub/github-workflows-kt for more info.
@file:Suppress(
"DataClassPrivateConstructor",
"UNUSED_PARAMETER",
)
package io.github.typesafegithub.workflows.actions.github
import io.github.typesafegithub.workflows.domain.actions.Action
import io.github.typesafegithub.workflows.domain.actions.RegularAction
import java.util.LinkedHashMap
import kotlin.Boolean
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.collections.toList
import kotlin.collections.toTypedArray
/**
* Action: CodeQL: Init
*
* Set up CodeQL
*
* [Action on GitHub](https://github.com/github/codeql-action/tree/v2/init)
*
* @param tools URL of CodeQL tools
* @param languages The languages to be analysed
* @param token GitHub token to use for authenticating with this instance of GitHub. To download
* custom packs from multiple registries, use the registries input.
* @param registries Use this input only when you need to download CodeQL packages from another
* instance of GitHub. If you only need to download packages from this GitHub instance, use the token
* input instead.
*
* A YAML string that defines the list of GitHub container registries to use for downloading packs.
* The string is in the following form (the | is required on the first line):
*
* registries: |
* - url: https://containers.GHEHOSTNAME1/v2/
* packages:
* - my-company/*
* - my-company2/*
* token: \$\{{ secrets.GHEHOSTNAME1_TOKEN }}
*
* - url: https://ghcr.io/v2/
* packages: */*
* token: \$\{{ secrets.GHCR_TOKEN }}
*
* The `url` property contains the URL to the container registry you want to connect to.
*
* The `packages` property contains a single glob string or a list of glob strings, specifying which
* packages should be retrieved from this particular container registry. Order is important. Earlier
* entries will match before later entries.
*
* The `token` property contains a connection token for this registry. required: false
* @param configFile Path of the config file to use
* @param dbLocation Path where CodeQL databases should be created. If not specified, a temporary
* directory will be used.
* @param queries Comma-separated list of additional queries to run. By default, this overrides the
* same setting in a configuration file; prefix with "+" to use both sets of queries.
* @param packs [Experimental] Comma-separated list of packs to run. Reference a pack in the format
* `scope/name[@version]`. If `version` is not specified, then the latest version of the pack is used.
* By default, this overrides the same setting in a configuration file; prefix with "+" to use both
* sets of packs.
* This input is only available in single-language analyses. To use packs in multi-language
* analyses, you must specify packs in the codeql-config.yml file.
* @param externalRepositoryToken A token for fetching external config files and queries if they
* reside in a private repository in the same GitHub instance that is running this action.
* @param setupPythonDependencies Try to auto-install your python dependencies
* @param sourceRoot Path of the root source code directory, relative to $GITHUB_WORKSPACE.
* @param ram The amount of memory in MB that can be used by CodeQL extractors. By default, CodeQL
* extractors will use most of the memory available in the system (which for GitHub-hosted runners is
* 6GB for Linux, 5.5GB for Windows, and 13GB for macOS). This input also sets the amount of memory
* that can later be used by the "analyze" action.
* @param threads The number of threads that can be used by CodeQL extractors. By default, CodeQL
* extractors will use all the hardware threads available in the system (which for GitHub-hosted
* runners is 2 for Linux and Windows and 3 for macOS). This input also sets the number of threads that
* can later be used by the "analyze" action.
* @param debug Enable debugging mode. This will result in more output being produced which may be
* useful when debugging certain issues. Debugging mode is enabled automatically when step debug
* logging is turned on.
* @param debugArtifactName The name of the artifact to store debugging information in. This is only
* used when debug mode is enabled.
* @param debugDatabaseName The name of the database uploaded to the debugging artifact. This is
* only used when debug mode is enabled.
* @param trapCaching Explicitly enable or disable TRAP caching rather than respecting the feature
* flag for it.
* @param _customInputs Type-unsafe map where you can put any inputs that are not yet supported by
* the binding
* @param _customVersion Allows overriding action's version, for example to use a specific minor
* version, or a newer version that the binding doesn't yet know about
*/
public data class CodeqlActionInitV2 private constructor(
/**
* URL of CodeQL tools
*/
public val tools: String? = null,
/**
* The languages to be analysed
*/
public val languages: List<String>? = null,
/**
* GitHub token to use for authenticating with this instance of GitHub. To download custom packs
* from multiple registries, use the registries input.
*/
public val token: String? = null,
/**
* Use this input only when you need to download CodeQL packages from another instance of
* GitHub. If you only need to download packages from this GitHub instance, use the token input
* instead.
*
* A YAML string that defines the list of GitHub container registries to use for downloading
* packs. The string is in the following form (the | is required on the first line):
*
* registries: |
* - url: https://containers.GHEHOSTNAME1/v2/
* packages:
* - my-company/*
* - my-company2/*
* token: \$\{{ secrets.GHEHOSTNAME1_TOKEN }}
*
* - url: https://ghcr.io/v2/
* packages: */*
* token: \$\{{ secrets.GHCR_TOKEN }}
*
* The `url` property contains the URL to the container registry you want to connect to.
*
* The `packages` property contains a single glob string or a list of glob strings, specifying
* which packages should be retrieved from this particular container registry. Order is important.
* Earlier entries will match before later entries.
*
* The `token` property contains a connection token for this registry. required: false
*/
public val registries: String? = null,
public val matrix: String? = null,
/**
* Path of the config file to use
*/
public val configFile: String? = null,
/**
* Path where CodeQL databases should be created. If not specified, a temporary directory will
* be used.
*/
public val dbLocation: String? = null,
/**
* Comma-separated list of additional queries to run. By default, this overrides the same
* setting in a configuration file; prefix with "+" to use both sets of queries.
*/
public val queries: List<String>? = null,
/**
* [Experimental] Comma-separated list of packs to run. Reference a pack in the format
* `scope/name[@version]`. If `version` is not specified, then the latest version of the pack is
* used. By default, this overrides the same setting in a configuration file; prefix with "+" to
* use both sets of packs.
* This input is only available in single-language analyses. To use packs in multi-language
* analyses, you must specify packs in the codeql-config.yml file.
*/
public val packs: List<String>? = null,
/**
* A token for fetching external config files and queries if they reside in a private repository
* in the same GitHub instance that is running this action.
*/
public val externalRepositoryToken: String? = null,
/**
* Try to auto-install your python dependencies
*/
public val setupPythonDependencies: Boolean? = null,
/**
* Path of the root source code directory, relative to $GITHUB_WORKSPACE.
*/
public val sourceRoot: String? = null,
/**
* The amount of memory in MB that can be used by CodeQL extractors. By default, CodeQL
* extractors will use most of the memory available in the system (which for GitHub-hosted runners
* is 6GB for Linux, 5.5GB for Windows, and 13GB for macOS). This input also sets the amount of
* memory that can later be used by the "analyze" action.
*/
public val ram: Int? = null,
/**
* The number of threads that can be used by CodeQL extractors. By default, CodeQL extractors
* will use all the hardware threads available in the system (which for GitHub-hosted runners is 2
* for Linux and Windows and 3 for macOS). This input also sets the number of threads that can
* later be used by the "analyze" action.
*/
public val threads: Int? = null,
/**
* Enable debugging mode. This will result in more output being produced which may be useful
* when debugging certain issues. Debugging mode is enabled automatically when step debug logging
* is turned on.
*/
public val debug: Boolean? = null,
/**
* The name of the artifact to store debugging information in. This is only used when debug mode
* is enabled.
*/
public val debugArtifactName: String? = null,
/**
* The name of the database uploaded to the debugging artifact. This is only used when debug
* mode is enabled.
*/
public val debugDatabaseName: String? = null,
/**
* Explicitly enable or disable TRAP caching rather than respecting the feature flag for it.
*/
public val trapCaching: Boolean? = null,
/**
* Type-unsafe map where you can put any inputs that are not yet supported by the binding
*/
public val _customInputs: Map<String, String> = mapOf(),
/**
* Allows overriding action's version, for example to use a specific minor version, or a newer
* version that the binding doesn't yet know about
*/
public val _customVersion: String? = null,
) : RegularAction<CodeqlActionInitV2.Outputs>("github", "codeql-action/init", _customVersion ?:
"v2") {
public constructor(
vararg pleaseUseNamedArguments: Unit,
tools: String? = null,
languages: List<String>? = null,
token: String? = null,
registries: String? = null,
matrix: String? = null,
configFile: String? = null,
dbLocation: String? = null,
queries: List<String>? = null,
packs: List<String>? = null,
externalRepositoryToken: String? = null,
setupPythonDependencies: Boolean? = null,
sourceRoot: String? = null,
ram: Int? = null,
threads: Int? = null,
debug: Boolean? = null,
debugArtifactName: String? = null,
debugDatabaseName: String? = null,
trapCaching: Boolean? = null,
_customInputs: Map<String, String> = mapOf(),
_customVersion: String? = null,
) : this(tools=tools, languages=languages, token=token, registries=registries, matrix=matrix,
configFile=configFile, dbLocation=dbLocation, queries=queries, packs=packs,
externalRepositoryToken=externalRepositoryToken,
setupPythonDependencies=setupPythonDependencies, sourceRoot=sourceRoot, ram=ram,
threads=threads, debug=debug, debugArtifactName=debugArtifactName,
debugDatabaseName=debugDatabaseName, trapCaching=trapCaching,
_customInputs=_customInputs, _customVersion=_customVersion)
@Suppress("SpreadOperator")
override fun toYamlArguments(): LinkedHashMap<String, String> = linkedMapOf(
*listOfNotNull(
tools?.let { "tools" to it },
languages?.let { "languages" to it.joinToString(",") },
token?.let { "token" to it },
registries?.let { "registries" to it },
matrix?.let { "matrix" to it },
configFile?.let { "config-file" to it },
dbLocation?.let { "db-location" to it },
queries?.let { "queries" to it.joinToString(",") },
packs?.let { "packs" to it.joinToString(",") },
externalRepositoryToken?.let { "external-repository-token" to it },
setupPythonDependencies?.let { "setup-python-dependencies" to it.toString() },
sourceRoot?.let { "source-root" to it },
ram?.let { "ram" to it.toString() },
threads?.let { "threads" to it.toString() },
debug?.let { "debug" to it.toString() },
debugArtifactName?.let { "debug-artifact-name" to it },
debugDatabaseName?.let { "debug-database-name" to it },
trapCaching?.let { "trap-caching" to it.toString() },
*_customInputs.toList().toTypedArray(),
).toTypedArray()
)
override fun buildOutputObject(stepId: String): Outputs = Outputs(stepId)
public class Outputs(
stepId: String,
) : Action.Outputs(stepId) {
/**
* The path of the CodeQL binary used for analysis
*/
public val codeqlPath: String = "steps.$stepId.outputs.codeql-path"
}
}