mirror of
https://dev.azure.com/schwarzit/schwarzit.stackit-public/_git/audit-go
synced 2026-02-07 16:47:24 +00:00
Add snyk check
This commit is contained in:
parent
baeb466421
commit
26673e8962
1 changed files with 27 additions and 0 deletions
|
|
@ -20,6 +20,9 @@ stages:
|
|||
jobs:
|
||||
- job: GoBuildTest
|
||||
displayName: Run build and tests
|
||||
variables:
|
||||
- name: isCiBuild
|
||||
value: $[eq(variables['Build.SourceBranch'], 'refs/heads/main')]
|
||||
steps:
|
||||
- task: GoTool@0
|
||||
displayName: Install Go $(goVersion)
|
||||
|
|
@ -85,6 +88,30 @@ stages:
|
|||
condition: succeeded()
|
||||
displayName: Run tests
|
||||
|
||||
- task: SnykSecurityScan@1
|
||||
condition: and(succeeded(), eq(variables.isCiBuild, true))
|
||||
displayName: Snyk check (main branch)
|
||||
inputs:
|
||||
additionalArguments: "--remote-repo-url=$(Build.Repository.Uri)"
|
||||
failOnIssues: false
|
||||
monitorWhen: 'always'
|
||||
organization: 'xx-sit-odj-stackit-public'
|
||||
projectName: $(Build.Repository.Name)
|
||||
serviceConnectionEndpoint: 'xx-sit-odj-stackit-public-snyk'
|
||||
testType: 'app'
|
||||
|
||||
- task: SnykSecurityScan@1
|
||||
condition: and(succeeded(), eq(variables.isCiBuild, false))
|
||||
displayName: Snyk check
|
||||
inputs:
|
||||
additionalArguments: "--remote-repo-url=$(Build.Repository.Uri)"
|
||||
failOnIssues: false
|
||||
monitorWhen: 'never'
|
||||
organization: 'xx-sit-odj-stackit-public'
|
||||
projectName: $(Build.Repository.Name)
|
||||
serviceConnectionEndpoint: 'xx-sit-odj-stackit-public-snyk'
|
||||
testType: 'app'
|
||||
|
||||
- bash: sudo rm -rf .gomodcache
|
||||
condition: always()
|
||||
displayName: Clean up the local cache (.gomodcache)
|
||||
|
|
|
|||
Loading…
Reference in a new issue