Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.
fix: change actions to support PRs from forked repos (#2977)
Kian Jonescf0de709ed39
diff --git a/.github/workflows/alembic-validation.yml b/.github/workflows/alembic-validation.ymlindex e5db6758e..32b013982 100644--- a/.github/workflows/alembic-validation.yml+++ b/.github/workflows/alembic-validation.yml@@ -23,6 +23,8 @@ jobs:steps:- uses: actions/checkout@v4with:+ repository: ${{ github.event.pull_request.head.repo.full_name }}+ ref: ${{ github.event.pull_request.head.ref }}fetch-depth: 0- name: Get changed filesid: changed-files@@ -40,6 +42,9 @@ jobs:steps:- name: Checkoutuses: actions/checkout@v4+ with:+ repository: ${{ github.event.pull_request.head.repo.full_name }}+ ref: ${{ github.event.pull_request.head.ref }}- name: Install dependenciesshell: bash@@ -81,6 +86,9 @@ jobs:steps:- name: Checkoutuses: actions/checkout@v4+ with:+ repository: ${{ github.event.pull_request.head.repo.full_name }}+ ref: ${{ github.event.pull_request.head.ref }}- name: Install dependenciesshell: bashdiff --git a/.github/workflows/core-integration-tests.yml b/.github/workflows/core-integration-tests.ymlindex 32d36ef05..0d7486585 100644--- a/.github/workflows/core-integration-tests.yml+++ b/.github/workflows/core-integration-tests.yml@@ -21,6 +21,7 @@ jobs:with:test-type: 'integration'use-redis: true+ is-external-pr: ${{ github.event_name == 'pull_request_target' && !contains(github.event.pull_request.labels.*.name, 'safe to test') }}changed-files-pattern: |**.github/workflows/reusable-test-workflow.ymldiff --git a/.github/workflows/core-unit-test.yml b/.github/workflows/core-unit-test.ymlindex e1f0c5de4..7a11eed00 100644--- a/.github/workflows/core-unit-test.yml+++ b/.github/workflows/core-unit-test.yml@@ -21,6 +21,7 @@ jobs:with:test-type: 'unit'use-redis: true+ is-external-pr: ${{ github.event_name == 'pull_request_target' && !contains(github.event.pull_request.labels.*.name, 'safe to test') }}changed-files-pattern: |**.github/workflows/reusable-test-workflow.ymldiff --git a/.github/workflows/fern-docs-preview.yml b/.github/workflows/fern-docs-preview.ymlindex b15b4c044..dfc44fe21 100644--- a/.github/workflows/fern-docs-preview.yml+++ b/.github/workflows/fern-docs-preview.yml@@ -22,10 +22,13 @@ jobs:- name: Checkout repositoryuses: actions/checkout@v4with:+ repository: ${{ github.event.pull_request.head.repo.full_name }}+ ref: ${{ github.event.pull_request.head.ref }}submodules: true- name: Generate preview URLid: generate-docs+ if: github.event_name != 'pull_request_target' || contains(github.event.pull_request.labels.*.name, 'safe to test')working-directory: fernenv:FERN_TOKEN: ${{ secrets.FERN_TOKEN }}diff --git a/.github/workflows/fern-sdk-python-preview.yml b/.github/workflows/fern-sdk-python-preview.ymlindex 3ab669ea6..4b5c8d8f8 100644--- a/.github/workflows/fern-sdk-python-preview.yml+++ b/.github/workflows/fern-sdk-python-preview.yml@@ -31,6 +31,8 @@ jobs:steps:- uses: actions/checkout@v4with:+ repository: ${{ github.event.pull_request.head.repo.full_name }}+ ref: ${{ github.event.pull_request.head.ref }}submodules: truefetch-depth: 0- name: Get changed files@@ -67,6 +69,8 @@ jobs:- name: Checkout repouses: actions/checkout@v4with:+ repository: ${{ github.event.pull_request.head.repo.full_name }}+ ref: ${{ github.event.pull_request.head.ref }}submodules: true- name: Generate cache key@@ -83,6 +87,7 @@ jobs:key: ${{ steps.cache-key.outputs.key }}- name: Inject env vars into environment+ if: github.event_name != 'pull_request_target' || contains(github.event.pull_request.labels.*.name, 'safe to test')working-directory: .run: |while IFS= read -r line || [[ -n "$line" ]]; do@@ -129,6 +134,7 @@ jobs:uv run alembic upgrade head- name: Run letta server+ if: github.event_name != 'pull_request_target' || contains(github.event.pull_request.labels.*.name, 'safe to test')working-directory: .env:LETTA_PG_DB: postgres@@ -145,7 +151,7 @@ jobs:timeout 60 bash -c 'until curl -s http://localhost:8283/health; do sleep 1; done'- name: Generate Python SDK Preview- if: steps.restore-cache.outputs.cache-hit != 'true'+ if: (github.event_name != 'pull_request_target' || contains(github.event.pull_request.labels.*.name, 'safe to test')) && steps.restore-cache.outputs.cache-hit != 'true'working-directory: .env:FERN_TOKEN: ${{ secrets.FERN_TOKEN }}diff --git a/.github/workflows/reusable-test-workflow.yml b/.github/workflows/reusable-test-workflow.ymlindex 2dcfb785c..c940499b5 100644--- a/.github/workflows/reusable-test-workflow.yml+++ b/.github/workflows/reusable-test-workflow.yml@@ -68,6 +68,11 @@ on:required: falsetype: booleandefault: false+ is-external-pr:+ description: 'Whether this is an external PR that needs protection'+ required: false+ type: boolean+ default: falsejobs:changed-files:@@ -79,6 +84,8 @@ jobs:steps:- uses: actions/checkout@v4with:+ repository: ${{ github.event.pull_request.head.repo.full_name }}+ ref: ${{ github.event.pull_request.head.ref }}fetch-depth: 0- name: Get changed filesid: changed-files@@ -96,6 +103,9 @@ jobs:steps:- name: Checkoutuses: actions/checkout@v4+ with:+ repository: ${{ github.event.pull_request.head.repo.full_name }}+ ref: ${{ github.event.pull_request.head.ref }}- name: Generate cache keyif: inputs.skip-fern-generation != true || (!contains(needs.changed-files.outputs.all_changed_files, 'fern/openapi.json') && !contains(needs.changed-files.outputs.all_changed_files, 'fern/openapi-overrides.yml'))@@ -218,6 +228,9 @@ jobs:steps:- name: Checkoutuses: actions/checkout@v4+ with:+ repository: ${{ github.event.pull_request.head.repo.full_name }}+ ref: ${{ github.event.pull_request.head.ref }}- name: Install uvuses: astral-sh/setup-uv@v6@@ -292,6 +305,7 @@ jobs:psql -h localhost -U postgres -d postgres -c 'CREATE EXTENSION vector'uv run alembic upgrade head- name: Inject env vars into environment+ if: inputs.is-external-pr != trueworking-directory: .run: |# Get secrets and mask them before adding to environment@@ -311,7 +325,7 @@ jobs:chmod -R 755 /home/ci-runner/.letta/logs- name: Build and run docker dev server- if: inputs.use-docker+ if: inputs.use-docker && inputs.is-external-pr != trueenv:LETTA_PG_DB: lettaLETTA_PG_USER: letta@@ -329,6 +343,7 @@ jobs:bash scripts/wait_for_service.sh localhost:8083 -- echo "Service is ready"- name: Run tests+ if: inputs.is-external-pr != trueworking-directory: ${{ steps.detect-core-dir.outputs.dir }}env:# Database configuration (shared, but values depend on Docker usage)diff --git a/.github/workflows/send-message-integration-tests.yml b/.github/workflows/send-message-integration-tests.ymlindex a2a6ab824..fbee82e7c 100644--- a/.github/workflows/send-message-integration-tests.yml+++ b/.github/workflows/send-message-integration-tests.yml@@ -20,6 +20,7 @@ jobs:uses: ./.github/workflows/reusable-test-workflow.ymlwith:test-type: 'send-message'+ is-external-pr: ${{ github.event_name == 'pull_request_target' && !contains(github.event.pull_request.labels.*.name, 'safe to test') }}changed-files-pattern: |**.github/workflows/reusable-test-workflow.ymldiff --git a/.github/workflows/test-lmstudio.yml b/.github/workflows/test-lmstudio.ymlindex 83e76914d..dc1c07b2c 100644--- a/.github/workflows/test-lmstudio.yml+++ b/.github/workflows/test-lmstudio.yml@@ -31,6 +31,7 @@ jobs:uses: ./.github/workflows/reusable-test-workflow.ymlwith:test-type: "integration"+ is-external-pr: ${{ github.event_name == 'pull_request_target' && !contains(github.event.pull_request.labels.*.name, 'safe to test') }}install-args: "--extra postgres --extra external-tools --extra dev --extra cloud-tool-sandbox --extra google"test-command: "uv run pytest -svv tests/"timeout-minutes: 60diff --git a/.github/workflows/test-ollama.yml b/.github/workflows/test-ollama.ymlindex 20bcc4142..81f9dad6b 100644--- a/.github/workflows/test-ollama.yml+++ b/.github/workflows/test-ollama.yml@@ -31,6 +31,7 @@ jobs:uses: ./.github/workflows/reusable-test-workflow.ymlwith:test-type: "integration"+ is-external-pr: ${{ github.event_name == 'pull_request_target' && !contains(github.event.pull_request.labels.*.name, 'safe to test') }}install-args: "--extra postgres --extra external-tools --extra dev --extra cloud-tool-sandbox --extra google"test-command: "uv run --frozen pytest -svv tests/"timeout-minutes: 60diff --git a/.github/workflows/test-vllm.yml b/.github/workflows/test-vllm.ymlindex ee8448a34..dfed86e58 100644--- a/.github/workflows/test-vllm.yml+++ b/.github/workflows/test-vllm.yml@@ -27,6 +27,7 @@ jobs:uses: ./.github/workflows/reusable-test-workflow.ymlwith:test-type: "integration"+ is-external-pr: ${{ github.event_name == 'pull_request_target' && !contains(github.event.pull_request.labels.*.name, 'safe to test') }}install-args: "--extra postgres --extra external-tools --extra dev --extra cloud-tool-sandbox --extra google"test-command: "uv run --frozen pytest -svv tests/"timeout-minutes: 60