@@ -21,15 +21,15 @@ jobs:
2121 notification :
2222 runs-on : ubuntu-22.04
2323 timeout-minutes : 1
24- if : ${{ !github.event.pull_request.head.repo.fork && github.event.number }}
24+ if : ${{ github.event.number }}
2525 permissions :
2626 pull-requests : write
2727 steps :
2828 - uses : actions/checkout@v4
2929
3030 - uses : marocchino/sticky-pull-request-comment@v2
3131 with :
32- GITHUB_TOKEN : ${{ secrets.ALGOLIA_BOT_TOKEN }}
32+ GITHUB_TOKEN : ${{ secrets.ALGOLIA_BOT_TOKEN != '' && secrets.ALGOLIA_BOT_TOKEN || secrets.GITHUB_TOKEN }}
3333 message : |
3434 ### 🪓 The generated code will be pushed at the end of the CI.
3535
@@ -265,11 +265,11 @@ jobs:
265265 - name : Run e2e CTS
266266 id : cts-e2e
267267 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]') }}
269269 run : yarn cli cts run javascript ${{ fromJSON(needs.setup.outputs.JAVASCRIPT_DATA).toRun }} --no-client --no-requests
270270
271271 - 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' }}
273273 run : yarn cli cts run javascript ${{ fromJSON(needs.setup.outputs.JAVASCRIPT_DATA).toRun }} --no-client --no-requests
274274
275275 - name : Run benchmarks
@@ -379,11 +379,11 @@ jobs:
379379 - name : Run e2e CTS
380380 id : cts-e2e
381381 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]') }}
383383 run : yarn cli cts run ${{ matrix.client.language }} ${{ matrix.client.toRun }} --no-client --no-requests
384384
385385 - 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' }}
387387 run : yarn cli cts run ${{ matrix.client.language }} ${{ matrix.client.toRun }} --no-client --no-requests
388388
389389 - name : Run benchmarks
@@ -479,22 +479,26 @@ jobs:
479479 name : client swift${{ needs.setup.outputs.RUN_MACOS_SWIFT_CTS == 'true' && format('@{0}', fromJSON(needs.setup.outputs.SWIFT_DATA).version) || '' }} macos
480480 steps :
481481 - uses : actions/checkout@v4
482+ if : ${{ env.ALGOLIA_APPLICATION_ID != '' }}
482483
483484 - name : Download artifacts
485+ if : ${{ env.ALGOLIA_APPLICATION_ID != '' }}
484486 uses : ./scripts/ci/actions/restore-artifacts
485487 with :
486488 type : languages
487489 languages : |
488490 swift
489491
490492 - name : Setup
493+ if : ${{ env.ALGOLIA_APPLICATION_ID != '' }}
491494 uses : ./.github/actions/setup
492495 with :
493496 type : minimal
494497 language : swift
495498 version : ${{ fromJSON(needs.setup.outputs.SWIFT_DATA).version }}
496499
497500 - name : Run tests on macOS
501+ if : ${{ env.ALGOLIA_APPLICATION_ID != '' }}
498502 id : run-test
499503 continue-on-error : true
500504 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:
528532 with :
529533 fetch-depth : 0
530534 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 }}
533536
534537 - name : Download all artifacts
535538 uses : ./scripts/ci/actions/restore-artifacts
@@ -572,14 +575,14 @@ jobs:
572575 id : pushGeneratedCode
573576 run : yarn workspace scripts pushGeneratedCode
574577 env :
575- GITHUB_TOKEN : ${{ secrets.ALGOLIA_BOT_TOKEN }}
578+ GITHUB_TOKEN : ${{ secrets.ALGOLIA_BOT_TOKEN != '' && secrets.ALGOLIA_BOT_TOKEN || secrets.GITHUB_TOKEN }}
576579 PR_NUMBER : ${{ github.event.number }}
577580
578581 - name : update generation comment
579582 uses : marocchino/sticky-pull-request-comment@v2
580583 if : ${{ steps.pushGeneratedCode.outputs.GENERATED_COMMIT == '' }}
581584 with :
582- GITHUB_TOKEN : ${{ secrets.ALGOLIA_BOT_TOKEN }}
585+ GITHUB_TOKEN : ${{ secrets.ALGOLIA_BOT_TOKEN != '' && secrets.ALGOLIA_BOT_TOKEN || secrets.GITHUB_TOKEN }}
583586 message : |
584587 ### No code generated
585588
@@ -591,7 +594,7 @@ jobs:
591594 uses : marocchino/sticky-pull-request-comment@v2
592595 if : ${{ steps.pushGeneratedCode.outputs.GENERATED_COMMIT != '' }}
593596 with :
594- GITHUB_TOKEN : ${{ secrets.ALGOLIA_BOT_TOKEN }}
597+ GITHUB_TOKEN : ${{ secrets.ALGOLIA_BOT_TOKEN != '' && secrets.ALGOLIA_BOT_TOKEN || secrets.GITHUB_TOKEN }}
595598 message : |
596599 ### ✔️ Code generated!
597600
@@ -660,9 +663,8 @@ jobs:
660663 - uses : actions/checkout@v4
661664 with :
662665 fetch-depth : 0
663- ref : ${{ needs.codegen.outputs.generatedCommit }}
666+ ref : ${{ github.event.pull_request.head.ref }}
664667 token : ${{ secrets.ALGOLIA_BOT_TOKEN }}
665- repository : ${{ github.event.pull_request.head.repo.full_name }}
666668
667669 - name : Setup
668670 uses : ./.github/actions/setup
0 commit comments