Skip to content

Commit

Permalink
Add selective component governance step (#22150)
Browse files Browse the repository at this point in the history
* Add selective component governance step

* Use globals.yml in analyze job
  • Loading branch information
benbp authored Jan 16, 2024
1 parent e6c32f4 commit cc89915
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
13 changes: 10 additions & 3 deletions eng/pipelines/templates/jobs/archetype-sdk-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,15 +148,22 @@ stages:
- job: Analyze
displayName: Analyze
variables:
Codeql.Enabled: true
Codeql.BuildIdentifier: ${{ parameters.ServiceDirectory }}
Codeql.SkipTaskAutoInjection: false
- name: Codeql.Enabled
value: true
- name: Codeql.BuildIdentifier
value: ${{ parameters.ServiceDirectory }}
- name: Codeql.SkipTaskAutoInjection
value: false
pool:
name: azsdk-pool-mms-ubuntu-2004-general

steps:
- template: /eng/common/pipelines/templates/steps/check-spelling.yml

- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
displayName: "Component Detection"
condition: and(succeededOrFailed(), ne(variables['Build.Reason'],'PullRequest'))

- task: GoTool@0
inputs:
version: '1.21.0'
Expand Down
5 changes: 4 additions & 1 deletion eng/pipelines/templates/variables/globals.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@ variables:
# https://docs.opensource.microsoft.com/tools/cg/index.html
# https://github.com/microsoft/component-detection/blob/main/src/Microsoft.ComponentDetection.Detectors/go/GoComponentDetector.cs
EnableGoCliScan: true

# Disable CodeQL injections except for where we specifically enable it
Codeql.SkipTaskAutoInjection: true

# Set the default value so that 'Build Performance Tests' step can resolve it
UseAzcoreFromMain: $[eq(variables['Use.AzcoreFromMain'], 'true')]

# We enable this selectively to avoid overloading CG scanning/reporting on PR pipelines
skipComponentGovernanceDetection: true

0 comments on commit cc89915

Please sign in to comment.