Skip to content

Commit 8a5c572

Browse files
authored
Merge pull request #4532 from platformsh/github-does-not-like-yoda
actions platform was throwing weird parsing errors. it does not like …
2 parents 1d91ecf + 13a5046 commit 8a5c572

File tree

1 file changed

+18
-15
lines changed

1 file changed

+18
-15
lines changed

.github/workflows/pr-url-and-dependent.yaml

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@ name: Get PR URL, start dependent jobs
55
# types: [labeled,opened,reopened,synchronize]
66
on:
77
workflow_run:
8-
workflows: ["Build from fork"]
8+
workflows: ["Record information on PR and (maybe) Build from fork"]
99
types:
1010
- completed
1111

1212
env:
1313
PLATFORMSH_CLI_NO_INTERACTION: 1
1414
PLATFORM_PROJECT: ${{ vars.PROJECT_ID }}
1515
PLATFORMSH_CLI_DEFAULT_TIMEOUT: 60 # Increase timeout for CLI commands
16-
BRANCH_TITLE: ${{ vars.BFF_PREFIX }}-${{ github.event.number }}
1716
UPSUN_DOCS_PREFIX: "https://docs.upsun.com"
17+
1818
jobs:
1919
get_info_on_pr:
2020
runs-on: ubuntu-latest
@@ -24,7 +24,7 @@ jobs:
2424
headsha: ${{ steps.set_pr_head_sha.outputs.headsha }}
2525
basesha: ${{ steps.set_pr_base_sha.outputs.basesha }}
2626
prbranch: ${{ steps.set_pr_branch.outputs.branch }}
27-
continuetests: ${{ steps.set_contintue_tests.outputs.continue }}
27+
continuetests: ${{ steps.set_continue_tests.outputs.continue }}
2828
reposource: ${{ steps.set_repo_source.outputs.reposource }}
2929
steps:
3030
- name: Download info on PR
@@ -49,15 +49,17 @@ jobs:
4949
run: |
5050
BRANCH=$(cat branch.txt)
5151
echo "branch=${BRANCH}" >> $GITHUB_OUTPUT
52-
- id: set_contintue_tests
52+
- id: set_continue_tests
5353
run: |
5454
CONTINUE=$(cat continuetests.txt)
5555
echo "continue=${CONTINUE}" >> $GITHUB_OUTPUT
5656
- id: set_repo_source
5757
run: |
5858
SOURCE=$(cat forkorsource.txt)
5959
echo "reposource=${SOURCE}" >> $GITHUB_OUTPUT
60+
6061
get_pr_info:
62+
name: "get PR URL, list of changed files"
6163
needs:
6264
- get_info_on_pr
6365
runs-on: ubuntu-latest
@@ -68,9 +70,9 @@ jobs:
6870
HEADSHA: ${{ needs.get_info_on_pr.outputs.headsha }}
6971
PRNUM: ${{ needs.get_info_on_pr.outputs.prnum }}
7072
REPOSOURCE: ${{ needs.get_info_on_pr.outputs.reposource }}
71-
name: Get info on build from PR
73+
7274
# 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'
7476
outputs:
7577
pr_url: ${{ steps.get_env_url.outputs.pr_url }}
7678
pr_url_upsun: ${{ steps.get_env_url.outputs.pr_url_upsun }}
@@ -219,30 +221,31 @@ jobs:
219221
echo "Log for the failed activity, ID ${failedID}"
220222
platform activity:log ${failedID} --environment ${{ env.BRANCH }}
221223
exit 1
224+
225+
222226
dont_run_nonlabeled_forks:
227+
name: Warn about non-labeled PRs from forks
223228
needs:
224229
- 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 }}
229230
runs-on: ubuntu-latest
231+
if: needs.get_info_on_pr.outputs.continuetests == 'false'
230232
steps:
231233
- name: Warn the environment will not be built
232234
run: |
233235
echo "::warning::Pull Requests from forks will not have an environment built until they are given the appropriate label."
234236
237+
235238
run-redirection-tests:
236-
runs-on: ubuntu-latest
237239
name: Verify contracted redirections
238240
needs:
239241
- get_info_on_pr
240242
- get_pr_info
243+
runs-on: ubuntu-latest
241244
env:
242245
CONTINUE: ${{ needs.get_info_on_pr.outputs.continuetests }}
243246
HEADSHA: ${{ needs.get_info_on_pr.outputs.headsha }}
244247
# 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'
246249
steps:
247250
- uses: actions/checkout@v4
248251
with:
@@ -266,7 +269,7 @@ jobs:
266269
REPOSOURCE: ${{ needs.get_info_on_pr.outputs.reposource }}
267270
HEADSHA: ${{ needs.get_info_on_pr.outputs.headsha }}
268271
# 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'
270273
strategy:
271274
matrix:
272275
include:
@@ -276,15 +279,15 @@ jobs:
276279
url: ${{ needs.get_pr_info.outputs.pr_url_upsun }}
277280
steps:
278281
- uses: actions/checkout@v4
279-
if: 'source' == env.REPOSOURCE
282+
if: env.REPOSOURCE == 'source'
280283
with:
281284
# If this is the base repo, then we want to check out the PR branch so we can potentially run new tests/changes
282285
# that are included in the PR.
283286
fetch-depth: 0
284287
ref: ${{ env.HEADSHA }}
285288
- uses: actions/checkout@v4
286289
# 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'
288291
- uses: cypress-io/github-action@v6
289292
with:
290293
wait-on: ${{ matrix.url }}

0 commit comments

Comments
 (0)