@@ -21,15 +21,15 @@ jobs:
21
21
notification :
22
22
runs-on : ubuntu-22.04
23
23
timeout-minutes : 1
24
- if : ${{ !github.event.pull_request.head.repo.fork && github.event.number }}
24
+ if : ${{ github.event.number }}
25
25
permissions :
26
26
pull-requests : write
27
27
steps :
28
28
- uses : actions/checkout@v4
29
29
30
30
- uses : marocchino/sticky-pull-request-comment@v2
31
31
with :
32
- GITHUB_TOKEN : ${{ secrets.ALGOLIA_BOT_TOKEN }}
32
+ GITHUB_TOKEN : ${{ secrets.ALGOLIA_BOT_TOKEN != '' && secrets.ALGOLIA_BOT_TOKEN || secrets.GITHUB_TOKEN }}
33
33
message : |
34
34
### 🪓 The generated code will be pushed at the end of the CI.
35
35
@@ -265,11 +265,11 @@ jobs:
265
265
- name : Run e2e CTS
266
266
id : cts-e2e
267
267
continue-on-error : true
268
- if : ${{ !github.event.pull_request.head.repo.fork && !contains(format('{0} {1}', github.event.pull_request.title, github.event.head_commit.message), '[skip-e2e]') }}
268
+ if : ${{ env.ALGOLIA_APPLICATION_ID != '' && !contains(format('{0} {1}', github.event.pull_request.title, github.event.head_commit.message), '[skip-e2e]') }}
269
269
run : yarn cli cts run javascript ${{ fromJSON(needs.setup.outputs.JAVASCRIPT_DATA).toRun }} --no-client --no-requests
270
270
271
271
- name : Retry e2e CTS
272
- if : ${{ !github.event.pull_request.head.repo.fork && steps.cts-e2e.outcome == 'failure' }}
272
+ if : ${{ steps.cts-e2e.outcome == 'failure' }}
273
273
run : yarn cli cts run javascript ${{ fromJSON(needs.setup.outputs.JAVASCRIPT_DATA).toRun }} --no-client --no-requests
274
274
275
275
- name : Run benchmarks
@@ -379,11 +379,11 @@ jobs:
379
379
- name : Run e2e CTS
380
380
id : cts-e2e
381
381
continue-on-error : true
382
- if : ${{ !github.event.pull_request.head.repo.fork && !contains(format('{0} {1}', github.event.pull_request.title, github.event.head_commit.message), '[skip-e2e]') }}
382
+ if : ${{ env.ALGOLIA_APPLICATION_ID != '' && !contains(format('{0} {1}', github.event.pull_request.title, github.event.head_commit.message), '[skip-e2e]') }}
383
383
run : yarn cli cts run ${{ matrix.client.language }} ${{ matrix.client.toRun }} --no-client --no-requests
384
384
385
385
- name : Retry e2e CTS
386
- if : ${{ !github.event.pull_request.head.repo.fork && steps.cts-e2e.outcome == 'failure' }}
386
+ if : ${{ steps.cts-e2e.outcome == 'failure' }}
387
387
run : yarn cli cts run ${{ matrix.client.language }} ${{ matrix.client.toRun }} --no-client --no-requests
388
388
389
389
- name : Run benchmarks
@@ -479,22 +479,26 @@ jobs:
479
479
name : client swift${{ needs.setup.outputs.RUN_MACOS_SWIFT_CTS == 'true' && format('@{0}', fromJSON(needs.setup.outputs.SWIFT_DATA).version) || '' }} macos
480
480
steps :
481
481
- uses : actions/checkout@v4
482
+ if : ${{ env.ALGOLIA_APPLICATION_ID != '' }}
482
483
483
484
- name : Download artifacts
485
+ if : ${{ env.ALGOLIA_APPLICATION_ID != '' }}
484
486
uses : ./scripts/ci/actions/restore-artifacts
485
487
with :
486
488
type : languages
487
489
languages : |
488
490
swift
489
491
490
492
- name : Setup
493
+ if : ${{ env.ALGOLIA_APPLICATION_ID != '' }}
491
494
uses : ./.github/actions/setup
492
495
with :
493
496
type : minimal
494
497
language : swift
495
498
version : ${{ fromJSON(needs.setup.outputs.SWIFT_DATA).version }}
496
499
497
500
- name : Run tests on macOS
501
+ if : ${{ env.ALGOLIA_APPLICATION_ID != '' }}
498
502
id : run-test
499
503
continue-on-error : true
500
504
run : yarn cli cts run swift ${{ fromJSON(needs.setup.outputs.SWIFT_DATA).toRun }} -v ${{ !contains(format('{0} {1}', github.event.pull_request.title, github.event.head_commit.message), '[skip-e2e]') && '--no-e2e' || '' }}
@@ -528,8 +532,7 @@ jobs:
528
532
with :
529
533
fetch-depth : 0
530
534
ref : ${{ github.event.pull_request.head.ref }}
531
- token : ${{ secrets.ALGOLIA_BOT_TOKEN }}
532
- repository : ${{ github.event.pull_request.head.repo.full_name }}
535
+ token : ${{ secrets.ALGOLIA_BOT_TOKEN != '' && secrets.ALGOLIA_BOT_TOKEN || secrets.GITHUB_TOKEN }}
533
536
534
537
- name : Download all artifacts
535
538
uses : ./scripts/ci/actions/restore-artifacts
@@ -572,14 +575,14 @@ jobs:
572
575
id : pushGeneratedCode
573
576
run : yarn workspace scripts pushGeneratedCode
574
577
env :
575
- GITHUB_TOKEN : ${{ secrets.ALGOLIA_BOT_TOKEN }}
578
+ GITHUB_TOKEN : ${{ secrets.ALGOLIA_BOT_TOKEN != '' && secrets.ALGOLIA_BOT_TOKEN || secrets.GITHUB_TOKEN }}
576
579
PR_NUMBER : ${{ github.event.number }}
577
580
578
581
- name : update generation comment
579
582
uses : marocchino/sticky-pull-request-comment@v2
580
583
if : ${{ steps.pushGeneratedCode.outputs.GENERATED_COMMIT == '' }}
581
584
with :
582
- GITHUB_TOKEN : ${{ secrets.ALGOLIA_BOT_TOKEN }}
585
+ GITHUB_TOKEN : ${{ secrets.ALGOLIA_BOT_TOKEN != '' && secrets.ALGOLIA_BOT_TOKEN || secrets.GITHUB_TOKEN }}
583
586
message : |
584
587
### No code generated
585
588
@@ -591,7 +594,7 @@ jobs:
591
594
uses : marocchino/sticky-pull-request-comment@v2
592
595
if : ${{ steps.pushGeneratedCode.outputs.GENERATED_COMMIT != '' }}
593
596
with :
594
- GITHUB_TOKEN : ${{ secrets.ALGOLIA_BOT_TOKEN }}
597
+ GITHUB_TOKEN : ${{ secrets.ALGOLIA_BOT_TOKEN != '' && secrets.ALGOLIA_BOT_TOKEN || secrets.GITHUB_TOKEN }}
595
598
message : |
596
599
### ✔️ Code generated!
597
600
@@ -660,9 +663,8 @@ jobs:
660
663
- uses : actions/checkout@v4
661
664
with :
662
665
fetch-depth : 0
663
- ref : ${{ needs.codegen.outputs.generatedCommit }}
666
+ ref : ${{ github.event.pull_request.head.ref }}
664
667
token : ${{ secrets.ALGOLIA_BOT_TOKEN }}
665
- repository : ${{ github.event.pull_request.head.repo.full_name }}
666
668
667
669
- name : Setup
668
670
uses : ./.github/actions/setup
0 commit comments