Skip to content

Same agent Smaller bill. The tools and infrastructure to get more work from your AI. Fewer tokens. Less compute. Lower cost.

fix(ci): replace pull_request_target with pull_request to prevent secret exfiltration (#1017)

Aman Agarwal4a62039a1659
diff --git a/.github/workflows/pricing-test.yml b/.github/workflows/pricing-test.yml
index 17c72256..5e445732 100644
--- a/.github/workflows/pricing-test.yml
+++ b/.github/workflows/pricing-test.yml
@@ -5,7 +5,7 @@ on:
branches: [ "main" ]
paths:
- 'assets/pricing.json'
- pull_request_target:
+ pull_request:
branches: [ "main" ]
paths:
- 'assets/pricing.json'
@@ -13,6 +13,9 @@ on:
schedule:
- cron: '0 0 1-31/15 * *'
+permissions:
+ contents: read
+
jobs:
validate-pricing:
runs-on: ubuntu-latest
@@ -20,8 +23,6 @@ jobs:
steps:
- name: Checkout base code
uses: actions/checkout@v5
- with:
- ref: ${{ github.event.pull_request.head.sha }}
- name: Validate JSON structure
id: validate
diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml
index adc9baa3..97d99e01 100644
--- a/.github/workflows/pylint.yml
+++ b/.github/workflows/pylint.yml
@@ -1,11 +1,14 @@
name: Pylint
on:
- pull_request_target:
+ pull_request:
branches: [ "main" ]
paths:
- 'sdk/python/**'
+permissions:
+ contents: read
+
jobs:
lint:
runs-on: ubuntu-latest
@@ -16,8 +19,6 @@ jobs:
steps:
- name: Checkout base code
uses: actions/checkout@v5
- with:
- ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml
index a6b4b084..93d33f36 100644
--- a/.github/workflows/python-tests.yml
+++ b/.github/workflows/python-tests.yml
@@ -5,7 +5,7 @@ on:
branches: [ "main" ]
paths:
- 'sdk/python/**'
- pull_request_target:
+ pull_request:
branches: [ "main" ]
paths:
- 'sdk/python/**'
@@ -13,45 +13,46 @@ on:
schedule:
- cron: '0 0 1-31/15 * *'
-env:
- OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
- CO_API_KEY: ${{ secrets.CO_API_KEY }}
- ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
- MISTRAL_API_KEY: ${{ secrets.MISTRAL_API_KEY }}
- PINECONE_API_KEY: ${{ secrets.PINECONE_API_KEY }}
- GROQ_API_KEY: ${{ secrets.GROQ_API_KEY }}
- QDRANT_URL: ${{ secrets.QDRANT_URL }}
- QDRANT_API_TOKEN: ${{ secrets.QDRANT_API_TOKEN }}
- MILVUS_URL: ${{ secrets.MILVUS_URL }}
- MILVUS_API_TOKEN: ${{ secrets.MILVUS_API_TOKEN }}
- ELEVEN_API_KEY: ${{ secrets.ELEVEN_API_KEY }}
- GOOGLE_AI_STUDIO_API_TOKEN: ${{ secrets.GOOGLE_AI_STUDIO_API_TOKEN }}
- AZURE_AI_INFERENCE_API_TOKEN: ${{ secrets.AZURE_AI_INFERENCE_API_TOKEN }}
- REKA_API_KEY: ${{ secrets.REKA_API_KEY }}
- PREM_API_KEY: ${{ secrets.PREM_API_KEY }}
- MULTION_API_KEY: ${{ secrets.MULTION_API_KEY }}
- XAI_API_KEY: ${{ secrets.XAI_API_KEY }}
- JULEP_API_KEY: ${{ secrets.JULEP_API_KEY }}
- ASTRA_DB_API_ENDPOINT: ${{ secrets.ASTRA_DB_API_ENDPOINT }}
- ASTRA_DB_APPLICATION_TOKEN: ${{ secrets.ASTRA_DB_APPLICATION_TOKEN }}
- AI21_API_KEY: ${{ secrets.AI21_API_KEY }}
- ASSEMBLYAI_API_KEY: ${{ secrets.ASSEMBLYAI_API_KEY }}
- FIRECRAWL_API_KEY: ${{ secrets.FIRECRAWL_API_KEY }}
- TOGETHER_API_KEY: ${{ secrets.TOGETHER_API_KEY }}
+permissions:
+ contents: read
jobs:
build:
runs-on: ubuntu-latest
+ if: github.event_name != 'pull_request'
strategy:
fail-fast: false
matrix:
python-version: ["3.12"]
+ env:
+ OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
+ CO_API_KEY: ${{ secrets.CO_API_KEY }}
+ ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
+ MISTRAL_API_KEY: ${{ secrets.MISTRAL_API_KEY }}
+ PINECONE_API_KEY: ${{ secrets.PINECONE_API_KEY }}
+ GROQ_API_KEY: ${{ secrets.GROQ_API_KEY }}
+ QDRANT_URL: ${{ secrets.QDRANT_URL }}
+ QDRANT_API_TOKEN: ${{ secrets.QDRANT_API_TOKEN }}
+ MILVUS_URL: ${{ secrets.MILVUS_URL }}
+ MILVUS_API_TOKEN: ${{ secrets.MILVUS_API_TOKEN }}
+ ELEVEN_API_KEY: ${{ secrets.ELEVEN_API_KEY }}
+ GOOGLE_AI_STUDIO_API_TOKEN: ${{ secrets.GOOGLE_AI_STUDIO_API_TOKEN }}
+ AZURE_AI_INFERENCE_API_TOKEN: ${{ secrets.AZURE_AI_INFERENCE_API_TOKEN }}
+ REKA_API_KEY: ${{ secrets.REKA_API_KEY }}
+ PREM_API_KEY: ${{ secrets.PREM_API_KEY }}
+ MULTION_API_KEY: ${{ secrets.MULTION_API_KEY }}
+ XAI_API_KEY: ${{ secrets.XAI_API_KEY }}
+ JULEP_API_KEY: ${{ secrets.JULEP_API_KEY }}
+ ASTRA_DB_API_ENDPOINT: ${{ secrets.ASTRA_DB_API_ENDPOINT }}
+ ASTRA_DB_APPLICATION_TOKEN: ${{ secrets.ASTRA_DB_APPLICATION_TOKEN }}
+ AI21_API_KEY: ${{ secrets.AI21_API_KEY }}
+ ASSEMBLYAI_API_KEY: ${{ secrets.ASSEMBLYAI_API_KEY }}
+ FIRECRAWL_API_KEY: ${{ secrets.FIRECRAWL_API_KEY }}
+ TOGETHER_API_KEY: ${{ secrets.TOGETHER_API_KEY }}
steps:
- name: Checkout base code
uses: actions/checkout@v5
- with:
- ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
diff --git a/.github/workflows/ui-test.yml b/.github/workflows/ui-test.yml
index c83ebabd..8709ee1b 100644
--- a/.github/workflows/ui-test.yml
+++ b/.github/workflows/ui-test.yml
@@ -1,11 +1,14 @@
name: Test OpenLIT
on:
- pull_request_target:
+ pull_request:
branches: [main]
paths:
- 'src/**'
+permissions:
+ contents: read
+
jobs:
build:
runs-on: ubuntu-latest
@@ -13,8 +16,6 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v5
- with:
- ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3