mirror of
https://dev.azure.com/schwarzit/schwarzit.stackit-public/_git/audit-go
synced 2026-02-14 20:07:25 +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:
|
jobs:
|
||||||
- job: GoBuildTest
|
- job: GoBuildTest
|
||||||
displayName: Run build and tests
|
displayName: Run build and tests
|
||||||
|
variables:
|
||||||
|
- name: isCiBuild
|
||||||
|
value: $[eq(variables['Build.SourceBranch'], 'refs/heads/main')]
|
||||||
steps:
|
steps:
|
||||||
- task: GoTool@0
|
- task: GoTool@0
|
||||||
displayName: Install Go $(goVersion)
|
displayName: Install Go $(goVersion)
|
||||||
|
|
@ -85,6 +88,30 @@ stages:
|
||||||
condition: succeeded()
|
condition: succeeded()
|
||||||
displayName: Run tests
|
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
|
- bash: sudo rm -rf .gomodcache
|
||||||
condition: always()
|
condition: always()
|
||||||
displayName: Clean up the local cache (.gomodcache)
|
displayName: Clean up the local cache (.gomodcache)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue