Skip to content

Commit 8d5c012

Browse files
azure-pipelines: Only enable signing on builds that aren't PRs and on specific branches (#1780)
* Add isPR variable * Add param * Fixup * Try this * Use a parameter * Try this? * Try this * Try this * Fixup * Fix * Fix comments * Fixup
1 parent c9a881e commit 8d5c012

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

azure-pipelines/1esstages.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ stages:
1919
templateContext:
2020
mb: # Enable the MicroBuild Signing toolset
2121
signing:
22-
enabled: true
22+
# Enable the signing toolset when the build is not a PR and the branch is main or starts with rel/
23+
enabled: $[and(ne(variables['Build.Reason'], 'PullRequest'), or(eq(variables['Build.SourceBranchName'], 'main'), startsWith(variables['Build.SourceBranchName'], 'rel/')))]
2324
signType: real # options are 'real' & 'test'
2425
zipSources: false
2526
outputs:

azure-pipelines/templates/sign.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ steps:
1111
Write-Output "SignExtension.signproj file not found. Skipping signing."
1212
}
1313
displayName: "\U0001F449 Check for SignExtension.signproj File"
14+
# Run this step when the build is not a PR and the branch is main or starts with rel/
15+
condition: and(ne(variables['Build.Reason'], 'PullRequest'), or(eq(variables['Build.SourceBranchName'], 'main'), startsWith(variables['Build.SourceBranchName'], 'rel/')))
1416
1517
# 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)
1618
- pwsh: |

0 commit comments

Comments
 (0)