Open vnickolov opened 2 years ago
To anyone it might concern - it might be a bit better to run it like this
open class SnykCodeTask : SnykTask() {
@TaskAction
fun doCodeTestTask() {
log.debug("Snyk Test Task")
authentication()
val output = runSnykCommand("code test")
log.lifecycle(output.output)
if (output.exitcode > 0) {
throw GradleException("Snyk Test failed")
}
}
}
tasks.register<SnykCodeTask>("snyk-code-test")
this utilizes functions available in parent SnykTask
and correctly propagates all arguments provided in snyk
block.
Anyway I agree that it would be nice to have it supported out of the box.
Hello 👋
Is there a way to configure the plugin to run equivalent of
snyk code test
which is the command for scanning the code under development rather than its depencencies?So far we've achieved this by adding a handcrafted task, but we think it's more hack than a solution.
Thank you in advance, Ves