@@ -21,15 +21,15 @@ jobs:
2121 notification :
2222 runs-on : ubuntu-22.04
2323 timeout-minutes : 1
24- if : ${{ github.event.number }}
24+ if : ${{ !github.event.pull_request.head.repo.fork && 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 != '' && secrets.ALGOLIA_BOT_TOKEN || secrets.GITHUB_TOKEN }}
32+ GITHUB_TOKEN : ${{ secrets.ALGOLIA_BOT_TOKEN }}
3333 message : |
3434 ### 🪓 The generated code will be pushed at the end of the CI.
3535
@@ -265,7 +265,7 @@ jobs:
265265 - name : Run e2e CTS
266266 id : cts-e2e
267267 continue-on-error : true
268- if : ${{ env.ALGOLIA_APPLICATION_ID != '' && !contains(format('{0} {1}', github.event.pull_request.title, github.event.head_commit.message), '[skip-e2e]') }}
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]') }}
269269 run : yarn cli cts run javascript ${{ fromJSON(needs.setup.outputs.JAVASCRIPT_DATA).toRun }} --no-client --no-requests
270270
271271 - name : Retry e2e CTS
@@ -379,7 +379,7 @@ jobs:
379379 - name : Run e2e CTS
380380 id : cts-e2e
381381 continue-on-error : true
382- if : ${{ env.ALGOLIA_APPLICATION_ID != '' && !contains(format('{0} {1}', github.event.pull_request.title, github.event.head_commit.message), '[skip-e2e]') }}
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]') }}
383383 run : yarn cli cts run ${{ matrix.client.language }} ${{ matrix.client.toRun }} --no-client --no-requests
384384
385385 - name : Retry e2e CTS
@@ -482,24 +482,24 @@ jobs:
482482 if : ${{ env.ALGOLIA_APPLICATION_ID != '' }}
483483
484484 - name : Download artifacts
485- if : ${{ env.ALGOLIA_APPLICATION_ID != '' }}
486485 uses : ./scripts/ci/actions/restore-artifacts
486+ if : ${{ env.ALGOLIA_APPLICATION_ID != '' }}
487487 with :
488488 type : languages
489489 languages : |
490490 swift
491491
492492 - name : Setup
493- if : ${{ env.ALGOLIA_APPLICATION_ID != '' }}
494493 uses : ./.github/actions/setup
494+ if : ${{ env.ALGOLIA_APPLICATION_ID != '' }}
495495 with :
496496 type : minimal
497497 language : swift
498498 version : ${{ fromJSON(needs.setup.outputs.SWIFT_DATA).version }}
499499
500500 - name : Run tests on macOS
501- if : ${{ env.ALGOLIA_APPLICATION_ID != '' }}
502501 id : run-test
502+ if : ${{ env.ALGOLIA_APPLICATION_ID != '' }}
503503 continue-on-error : true
504504 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' || '' }}
505505
@@ -533,6 +533,7 @@ jobs:
533533 fetch-depth : 0
534534 ref : ${{ github.event.pull_request.head.ref }}
535535 token : ${{ secrets.ALGOLIA_BOT_TOKEN != '' && secrets.ALGOLIA_BOT_TOKEN || secrets.GITHUB_TOKEN }}
536+ repository : ${{ github.event.pull_request.head.repo.full_name }}
536537
537538 - name : Download all artifacts
538539 uses : ./scripts/ci/actions/restore-artifacts
@@ -571,17 +572,12 @@ jobs:
571572 } >> "$GITHUB_OUTPUT"
572573 rm -rf tests/output/**/benchmarkResult.json
573574
574- - name : Extract branch name
575- id : extract_branch
576- run : echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
577-
578575 - name : Push generated code
579576 id : pushGeneratedCode
580577 run : yarn workspace scripts pushGeneratedCode
581578 env :
582579 GITHUB_TOKEN : ${{ secrets.ALGOLIA_BOT_TOKEN != '' && secrets.ALGOLIA_BOT_TOKEN || secrets.GITHUB_TOKEN }}
583580 PR_NUMBER : ${{ github.event.number }}
584- BRANCH_NAME : ${{ steps.extract_branch.outputs.branch }}
585581
586582 - name : update generation comment
587583 uses : marocchino/sticky-pull-request-comment@v2
0 commit comments