Skip to content
代码片段 群组 项目
未验证 提交 921d2c61 编辑于 作者: Doug Bunting's avatar Doug Bunting 提交者: GitHub
浏览文件

Stop remaining auto-injected component detection runs (#23755)

- was still running in every job where explicit CD build step did not execute
    - caused consistent errors in Linux MUSL x64 (Alpine) jobs
      - error was ignored but made build failure diagnosis more difficult
    - totally redundant in test jobs
上级 93634cd7
No related branches found
No related tags found
无相关合并请求
...@@ -242,6 +242,7 @@ jobs: ...@@ -242,6 +242,7 @@ jobs:
continueOnError: true continueOnError: true
condition: always() condition: always()
# Run component detection after all successful Build:* jobs unless overridden e.g. for Alpine build.
- ${{ if and(startsWith(parameters.jobDisplayName, 'Build:'), ne(variables['skipComponentGovernanceDetection'], 'true'), ne(parameters.skipComponentGovernanceDetection, 'true'), notin(variables['Build.Reason'], 'PullRequest')) }}: - ${{ if and(startsWith(parameters.jobDisplayName, 'Build:'), ne(variables['skipComponentGovernanceDetection'], 'true'), ne(parameters.skipComponentGovernanceDetection, 'true'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0 - task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
condition: and(succeeded(), ne(variables['CG_RAN'], 'true')) condition: and(succeeded(), ne(variables['CG_RAN'], 'true'))
...@@ -253,6 +254,11 @@ jobs: ...@@ -253,6 +254,11 @@ jobs:
ignoreDirectories: '.dotnet,.packages,artifacts/log,artifacts/symbols,artifacts/tmp' ignoreDirectories: '.dotnet,.packages,artifacts/log,artifacts/symbols,artifacts/tmp'
sourceScanPath: $(Build.SourcesDirectory) sourceScanPath: $(Build.SourcesDirectory)
verbosity: Verbose verbosity: Verbose
# Make sure auto-injected component detection does _not_ execute in other jobs nor when overridden.
# No need to recheck variables or build reason because auto-injected component detection honors those values.
- ${{ if or(not(startsWith(parameters.jobDisplayName, 'Build:')), eq(parameters.skipComponentGovernanceDetection, 'true')) }}:
- script: echo "##vso[task.setvariable variable=CG_RAN]true"
displayName: 'Skip Component Detection'
- ${{ each artifact in parameters.artifacts }}: - ${{ each artifact in parameters.artifacts }}:
- task: PublishBuildArtifacts@1 - task: PublishBuildArtifacts@1
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册