Skip to content

Commit 9d11880

Browse files
authored
Steps/BuildPlatform: Add toggle for stuart_pr_eval (#368)
Adds a True / False parameter to the BuildPlatform step to allow disabling PR evaluation, similar to that of Steps/PrGate.yml. Default value is True to match current behavior.
1 parent c1e4219 commit 9d11880

1 file changed

Lines changed: 15 additions & 10 deletions

File tree

Steps/BuildPlatform.yml

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ parameters:
2222
displayName: Build BaseTools
2323
type: boolean
2424
default: false
25+
- name: do_pr_eval
26+
displayName: Perform Stuart PR Evaluation
27+
type: boolean
28+
default: true
2529
- name: build_file
2630
displayName: Build File
2731
type: string
@@ -88,16 +92,17 @@ steps:
8892
- bash: echo "##vso[task.setvariable variable=pkg_count]${{ 1 }}"
8993

9094
# trim the package list if this is a PR
91-
- powershell:
92-
$TargetBranch = "$(System.PullRequest.targetBranch)".replace('refs/heads/', '');
93-
Write-Host "##vso[task.setvariable variable=pr_compare_branch]origin/$TargetBranch";
94-
displayName: Workaround for Branch Names
95-
condition: eq(variables['Build.Reason'], 'PullRequest')
96-
- task: CmdLine@2
97-
displayName: Check if ${{ parameters.build_pkg }} Needs Testing
98-
inputs:
99-
script: stuart_pr_eval -c ${{ parameters.build_file }} -t ${{ parameters.build_target}} --pr-target $(pr_compare_branch) --output-count-format-string "##vso[task.setvariable variable=pkg_count]{pkgcount}"
100-
condition: eq(variables['Build.Reason'], 'PullRequest')
95+
- ${{ if eq(parameters.do_pr_eval, true) }}:
96+
- powershell:
97+
$TargetBranch = "$(System.PullRequest.targetBranch)".replace('refs/heads/', '');
98+
Write-Host "##vso[task.setvariable variable=pr_compare_branch]origin/$TargetBranch";
99+
displayName: Workaround for Branch Names
100+
condition: eq(variables['Build.Reason'], 'PullRequest')
101+
- task: CmdLine@2
102+
displayName: Check if ${{ parameters.build_pkg }} Needs Testing
103+
inputs:
104+
script: stuart_pr_eval -c ${{ parameters.build_file }} -t ${{ parameters.build_target}} --pr-target $(pr_compare_branch) --output-count-format-string "##vso[task.setvariable variable=pkg_count]{pkgcount}"
105+
condition: eq(variables['Build.Reason'], 'PullRequest')
101106

102107
# Setup repo
103108
- task: CmdLine@2

0 commit comments

Comments
 (0)