@@ -87,6 +87,22 @@ commands:
87
87
name : Initialize Environment
88
88
command : ./.circleci/env.sh
89
89
90
+ rebase_pr :
91
+ steps :
92
+ - run :
93
+ name : Rebase PR on target branch
94
+ shell : bash
95
+ command : >
96
+ if [[ -n "${CIRCLE_PR_NUMBER}" ]]; then
97
+ # User is required for rebase.
98
+ git config user.name "angular-ci"
99
+ git config user.email "angular-ci"
100
+ # Rebase PR on top of target branch.
101
+ node tools/rebase-pr.js angular/angular-cli ${CIRCLE_PR_NUMBER}
102
+ else
103
+ echo "This build is not over a PR, nothing to do."
104
+ fi
105
+
90
106
custom_attach_workspace :
91
107
description : Attach workspace at a predefined location
92
108
steps :
@@ -145,18 +161,7 @@ jobs:
145
161
resource_class : medium
146
162
steps :
147
163
- checkout
148
- - run :
149
- name : Rebase PR on target branch
150
- command : >
151
- if [[ -n "${CIRCLE_PR_NUMBER}" ]]; then
152
- # User is required for rebase.
153
- git config user.name "angular-ci"
154
- git config user.email "angular-ci"
155
- # Rebase PR on top of target branch.
156
- node tools/rebase-pr.js angular/angular-cli ${CIRCLE_PR_NUMBER}
157
- else
158
- echo "This build is not over a PR, nothing to do."
159
- fi
164
+ - rebase_pr
160
165
- initialize_env
161
166
- restore_cache :
162
167
keys :
@@ -309,18 +314,7 @@ jobs:
309
314
parallelism : 8
310
315
steps :
311
316
- checkout
312
- - run :
313
- name : Rebase PR on target branch
314
- command : |
315
- if (Test-Path env:CIRCLE_PR_NUMBER) {
316
- # User is required for rebase.
317
- git config user.name "angular-ci"
318
- git config user.email "angular-ci"
319
- # Rebase PR on top of target branch.
320
- node tools/rebase-pr.js angular/angular-cli $env:CIRCLE_PR_NUMBER
321
- } else {
322
- echo "This build is not over a PR, nothing to do."
323
- }
317
+ - rebase_pr
324
318
- setup_windows
325
319
- restore_cache :
326
320
keys :
0 commit comments