Skip to content

Commit

Permalink
Enable Codeql in Analyze job for Go pipelines (#20682)
Browse files Browse the repository at this point in the history
* Enable CodeQL for scheduled builds only

* Do this in Analyze instead

* Adjust globals.yml scope and fix syntax

* fix globals.yml scoping again

* Update eng/pipelines/templates/jobs/archetype-sdk-client.yml

Co-authored-by: Ben Broderick Phillips <[email protected]>

---------

Co-authored-by: Ben Broderick Phillips <[email protected]>
  • Loading branch information
kurtzeborn and benbp authored Jun 21, 2023
1 parent 97c346e commit dc418a6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
4 changes: 4 additions & 0 deletions eng/pipelines/templates/jobs/archetype-go-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ parameters:

stages:
- stage: CheckRelease
variables:
- template: /eng/pipelines/templates/variables/globals.yml
displayName: 'Check Release: ${{ parameters.ServiceDirectory }}'
dependsOn: ${{ parameters.DependsOn }}
condition: and(succeeded(), ne(variables['SetDevVersion'], 'true'), ne(variables['Skip.Release'], 'true'), ne(variables['Build.Repository.Name'], 'Azure/azure-sdk-for-go-pr'))
Expand Down Expand Up @@ -34,6 +36,8 @@ stages:
env:
GH_TOKEN: $(azuresdk-github-pat)
- stage: Release
variables:
- template: /eng/pipelines/templates/variables/globals.yml
displayName: 'Release: ${{ parameters.ServiceDirectory }}'
dependsOn: CheckRelease
condition: and(succeeded(), eq(dependencies.CheckRelease.outputs['CheckReleaseJob.Verify.NeedToRelease'], 'true'))
Expand Down
10 changes: 7 additions & 3 deletions eng/pipelines/templates/jobs/archetype-sdk-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ parameters:

stages:
- stage: Build
variables:
- template: /eng/pipelines/templates/variables/globals.yml
jobs:
- job: Test
displayName: Build and Test on
variables:
- template: /eng/pipelines/templates/variables/globals.yml
strategy:
matrix:
${{ if eq(parameters.ExcludeGoNMinus2, false) }}:
Expand Down Expand Up @@ -145,7 +145,9 @@ stages:
- job: Analyze
displayName: Analyze
variables:
- template: /eng/pipelines/templates/variables/globals.yml
Codeql.Enabled: true
Codeql.BuildIdentifier: ${{ parameters.ServiceDirectory }}
Codeql.SkipTaskAutoInjection: false
pool:
name: azsdk-pool-mms-ubuntu-2004-general

Expand Down Expand Up @@ -173,6 +175,8 @@ stages:
- ${{ if or(contains(parameters.Clouds, cloud.key), and(contains(variables['Build.DefinitionName'], 'weekly'), contains(parameters.SupportedClouds, cloud.key))) }}:
- ${{ if not(contains(parameters.UnsupportedClouds, cloud.key)) }}:
- stage: ${{ cloud.key }}
variables:
- template: /eng/pipelines/templates/variables/globals.yml
displayName: Live Test ${{ cloud.key }}
dependsOn: []
jobs:
Expand Down
3 changes: 3 additions & 0 deletions eng/pipelines/templates/variables/globals.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ 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

0 comments on commit dc418a6

Please sign in to comment.