Skip to content

Commit

Permalink
azure-pipelines: Use new Guardian suppression files
Browse files Browse the repository at this point in the history
  • Loading branch information
sevoku committed Nov 13, 2024
1 parent f92ce31 commit b709012
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
2 changes: 2 additions & 0 deletions azure-pipelines/1esmain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ extends:
template: azure-pipelines/MicroBuild.1ES.Official.yml@1esPipelines
parameters:
sdl:
suppression:
suppressionFile: $(Build.SourcesDirectory)\.config\guardian\.gdnsuppress
credscan:
suppressionsFile: $(Build.SourcesDirectory)\.azure-pipelines\compliance\CredScanSuppressions.json
# codeql:
Expand Down
16 changes: 9 additions & 7 deletions azure-pipelines/release-extension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ parameters:
- name: runID
type: string

# The intended extension version to publish.
# The intended extension version to publish.
# This is used to verify the version in package.json matches the version to publish to avoid accidental publishing.
- name: publishVersion
type: string

# Customize the environment to associate the deployment with.
# Customize the environment to associate the deployment with.
# Useful to control which group of people should be required to approve the deployment.
- name: environmentName
type: string
Expand All @@ -33,6 +33,8 @@ extends:
template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines
parameters:
sdl:
suppression:
suppressionFile: $(Build.SourcesDirectory)\.config\guardian\.gdnsuppress
credscan:
suppressionsFile: $(Build.SourcesDirectory)\.azure-pipelines\compliance\CredScanSuppressions.json
codeql:
Expand Down Expand Up @@ -69,7 +71,7 @@ extends:
# Modify the build number to include repo name, extension version, and if dry run is true
- powershell: |
# Get the version from package.json
$packageJsonPath = "$(Build.SourcesDirectory)/package.json"
$npmVersionString = (Get-Content $packageJsonPath | ConvertFrom-Json).version
$isDryRun = "$env:dryRun"
Expand All @@ -78,7 +80,7 @@ extends:
$repoName = "$(Build.Repository.Name)"
$repoNameParts = $repoName -split '/'
$repoNameWithoutOwner = $repoNameParts[-1]
$dry = ""
if ($isDryRun -eq 'True') {
Write-Output "Dry run was set to True. Adding 'dry' to the build number."
Expand All @@ -87,7 +89,7 @@ extends:
$newBuildNumber = "$repoNameWithoutOwner-$npmVersionString-$dry-$currentBuildNumber"
Write-Output "##vso[build.updatebuildnumber]$newBuildNumber"
displayName: 'Prepend version from package.json to build number'
displayName: "Prepend version from package.json to build number"
env:
dryRun: ${{ parameters.dryRun }}
Expand All @@ -106,7 +108,7 @@ extends:
Write-Error "Publish version $publishVersion doesn't match version found in package.json $npmVersionString. Cancelling release."
exit 1
}
displayName: 'Verify publish version'
displayName: "Verify publish version"
env:
publishVersion: ${{ parameters.publishVersion }}
Expand Down Expand Up @@ -146,4 +148,4 @@ extends:
scriptType: pscore
scriptLocation: inlineScript
inlineScript: |
vsce publish --azure-credential --packagePath $(vsixFileName) --manifestPath extension.manifest --signaturePath extension.signature.p7s
vsce publish --azure-credential --packagePath $(vsixFileName) --manifestPath extension.manifest --signaturePath extension.signature.p7s

0 comments on commit b709012

Please sign in to comment.