@@ -5,16 +5,16 @@ name: Get PR URL, start dependent jobs
5
5
# types: [labeled,opened,reopened,synchronize]
6
6
on :
7
7
workflow_run :
8
- workflows : ["Build from fork"]
8
+ workflows : ["Record information on PR and (maybe) Build from fork"]
9
9
types :
10
10
- completed
11
11
12
12
env :
13
13
PLATFORMSH_CLI_NO_INTERACTION : 1
14
14
PLATFORM_PROJECT : ${{ vars.PROJECT_ID }}
15
15
PLATFORMSH_CLI_DEFAULT_TIMEOUT : 60 # Increase timeout for CLI commands
16
- BRANCH_TITLE : ${{ vars.BFF_PREFIX }}-${{ github.event.number }}
17
16
UPSUN_DOCS_PREFIX : " https://docs.upsun.com"
17
+
18
18
jobs :
19
19
get_info_on_pr :
20
20
runs-on : ubuntu-latest
24
24
headsha : ${{ steps.set_pr_head_sha.outputs.headsha }}
25
25
basesha : ${{ steps.set_pr_base_sha.outputs.basesha }}
26
26
prbranch : ${{ steps.set_pr_branch.outputs.branch }}
27
- continuetests : ${{ steps.set_contintue_tests .outputs.continue }}
27
+ continuetests : ${{ steps.set_continue_tests .outputs.continue }}
28
28
reposource : ${{ steps.set_repo_source.outputs.reposource }}
29
29
steps :
30
30
- name : Download info on PR
@@ -49,15 +49,17 @@ jobs:
49
49
run : |
50
50
BRANCH=$(cat branch.txt)
51
51
echo "branch=${BRANCH}" >> $GITHUB_OUTPUT
52
- - id : set_contintue_tests
52
+ - id : set_continue_tests
53
53
run : |
54
54
CONTINUE=$(cat continuetests.txt)
55
55
echo "continue=${CONTINUE}" >> $GITHUB_OUTPUT
56
56
- id : set_repo_source
57
57
run : |
58
58
SOURCE=$(cat forkorsource.txt)
59
59
echo "reposource=${SOURCE}" >> $GITHUB_OUTPUT
60
+
60
61
get_pr_info :
62
+ name : " get PR URL, list of changed files"
61
63
needs :
62
64
- get_info_on_pr
63
65
runs-on : ubuntu-latest
68
70
HEADSHA : ${{ needs.get_info_on_pr.outputs.headsha }}
69
71
PRNUM : ${{ needs.get_info_on_pr.outputs.prnum }}
70
72
REPOSOURCE : ${{ needs.get_info_on_pr.outputs.reposource }}
71
- name : Get info on build from PR
73
+
72
74
# Run only for PRs from default repo and approved PRs from forks
73
- if : env.CONTINUE == 'true'
75
+ if : needs.get_info_on_pr.outputs.continuetests == 'true'
74
76
outputs :
75
77
pr_url : ${{ steps.get_env_url.outputs.pr_url }}
76
78
pr_url_upsun : ${{ steps.get_env_url.outputs.pr_url_upsun }}
@@ -219,30 +221,31 @@ jobs:
219
221
echo "Log for the failed activity, ID ${failedID}"
220
222
platform activity:log ${failedID} --environment ${{ env.BRANCH }}
221
223
exit 1
224
+
225
+
222
226
dont_run_nonlabeled_forks :
227
+ name : Warn about non-labeled PRs from forks
223
228
needs :
224
229
- get_info_on_pr
225
- name : Warn about non-labeled PRs from forks
226
- env :
227
- CONTINUE : ${{ needs.get_info_on_pr.outputs.continuetests }}
228
- if : ${{ 'false' == env.CONTINUE }}
229
230
runs-on : ubuntu-latest
231
+ if : needs.get_info_on_pr.outputs.continuetests == 'false'
230
232
steps :
231
233
- name : Warn the environment will not be built
232
234
run : |
233
235
echo "::warning::Pull Requests from forks will not have an environment built until they are given the appropriate label."
234
236
237
+
235
238
run-redirection-tests :
236
- runs-on : ubuntu-latest
237
239
name : Verify contracted redirections
238
240
needs :
239
241
- get_info_on_pr
240
242
- get_pr_info
243
+ runs-on : ubuntu-latest
241
244
env :
242
245
CONTINUE : ${{ needs.get_info_on_pr.outputs.continuetests }}
243
246
HEADSHA : ${{ needs.get_info_on_pr.outputs.headsha }}
244
247
# this isn't REALLY needed since we're depending on get_pr_info and it only completes successfully
245
- if : ' true ' == env.CONTINUE
248
+ if : needs.get_info_on_pr.outputs.continuetests == 'true'
246
249
steps :
247
250
- uses : actions/checkout@v4
248
251
with :
@@ -266,7 +269,7 @@ jobs:
266
269
REPOSOURCE : ${{ needs.get_info_on_pr.outputs.reposource }}
267
270
HEADSHA : ${{ needs.get_info_on_pr.outputs.headsha }}
268
271
# this isn't REALLY needed since we're depending on get_pr_info and it only completes successfully
269
- if : ' true ' == env.CONTINUE
272
+ if : needs.get_info_on_pr.outputs.continuetests == 'true'
270
273
strategy :
271
274
matrix :
272
275
include :
@@ -276,15 +279,15 @@ jobs:
276
279
url : ${{ needs.get_pr_info.outputs.pr_url_upsun }}
277
280
steps :
278
281
- uses : actions/checkout@v4
279
- if : ' source ' == env.REPOSOURCE
282
+ if : env.REPOSOURCE == 'source'
280
283
with :
281
284
# If this is the base repo, then we want to check out the PR branch so we can potentially run new tests/changes
282
285
# that are included in the PR.
283
286
fetch-depth : 0
284
287
ref : ${{ env.HEADSHA }}
285
288
- uses : actions/checkout@v4
286
289
# if it isn't the base repo and we're in a fork then we'll checkout the base repo
287
- if : ' fork ' == env.REPOSOURCE
290
+ if : env.REPOSOURCE == 'fork'
288
291
- uses : cypress-io/github-action@v6
289
292
with :
290
293
wait-on : ${{ matrix.url }}
0 commit comments