Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

azure-pipelines: Only enable signing on builds that aren't PRs and on specific branches #1780

Merged
merged 12 commits into from
Aug 27, 2024
Merged
3 changes: 2 additions & 1 deletion azure-pipelines/1esstages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ stages:
templateContext:
mb: # Enable the MicroBuild Signing toolset
signing:
enabled: true
# Enable the signing toolset when the build is not a PR and the branch is main or starts with rel/
enabled: $[and(ne(variables['Build.Reason'], 'PullRequest'), or(eq(variables['Build.SourceBranchName'], 'main'), startsWith(variables['Build.SourceBranchName'], 'rel/')))]
signType: real # options are 'real' & 'test'
zipSources: false
outputs:
Expand Down
2 changes: 2 additions & 0 deletions azure-pipelines/templates/sign.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ steps:
Write-Output "SignExtension.signproj file not found. Skipping signing."
}
displayName: "\U0001F449 Check for SignExtension.signproj File"
# Run this step when the build is not a PR and the branch is main or starts with rel/
condition: and(ne(variables['Build.Reason'], 'PullRequest'), or(eq(variables['Build.SourceBranchName'], 'main'), startsWith(variables['Build.SourceBranchName'], 'rel/')))

# put the extension name and version from the package.json into variables to use later. Variables can be used in later steps as $(package.name) and $(package.version)
- pwsh: |
Expand Down
Loading