0d3cb498a3
Deploy local.promptfoo.app / Deploy to Cloudflare Pages (push) Waiting to run
Test and Publish Multi-arch Docker Image / test (push) Waiting to run
Test and Publish Multi-arch Docker Image / build-docker-and-push-digests (map[digest-suffix:linux-amd64 platform:linux/amd64 runner:ubuntu-latest]) (push) Blocked by required conditions
Test and Publish Multi-arch Docker Image / build-docker-and-push-digests (map[digest-suffix:linux-arm64 platform:linux/arm64 runner:ubuntu-24.04-arm]) (push) Blocked by required conditions
Test and Publish Multi-arch Docker Image / merge-docker-digests (push) Blocked by required conditions
Test and Publish Multi-arch Docker Image / Attest Multi-arch Image (push) Blocked by required conditions
Validate Renovate Config / Validate Renovate Configuration (push) Waiting to run
CI / Shell Format Check (push) Has been cancelled
CI / Check Ruby (3.4) (push) Has been cancelled
CI / CI Config (push) Has been cancelled
CI / Test on Node ${{ matrix.node }} and ${{ matrix.os }}${{ matrix.shard && format(' (shard {0}/3)', matrix.shard) || '' }} (push) Has been cancelled
CI / Build on Node ${{ matrix.node }} (push) Has been cancelled
CI / Style Check (push) Has been cancelled
CI / Generate Assets (push) Has been cancelled
CI / Check Python (3.14) (push) Has been cancelled
CI / Check Python (3.9) (push) Has been cancelled
CI / Build Docs (push) Has been cancelled
CI / Code Scan Action (push) Has been cancelled
CI / Site tests (push) Has been cancelled
CI / webui tests (push) Has been cancelled
CI / Run Integration Tests (push) Has been cancelled
CI / Run Smoke Tests (push) Has been cancelled
CI / Go Tests (push) Has been cancelled
CI / Share Test (push) Has been cancelled
CI / Redteam (Production API) (push) Has been cancelled
CI / Redteam (Staging API) (push) Has been cancelled
CI / GitHub Actions Lint (push) Has been cancelled
CI / Check Ruby (3.0) (push) Has been cancelled
release-please / release-please (push) Has been cancelled
release-please / build (push) Has been cancelled
release-please / publish-npm (push) Has been cancelled
release-please / publish-npm-backfill (push) Has been cancelled
release-please / docker (push) Has been cancelled
release-please / publish-code-scan-action (push) Has been cancelled
release-please / attest-code-scan-action (push) Has been cancelled
38 lines
1.3 KiB
Markdown
38 lines
1.3 KiB
Markdown
# integration-github-action (GitHub Action)
|
|
|
|
You can run this example with:
|
|
|
|
```bash
|
|
npx promptfoo@latest init --example integration-github-action
|
|
cd integration-github-action
|
|
```
|
|
|
|
This folder contains a standalone GitHub Action that runs **promptfoo** when a pull request modifies prompts.
|
|
|
|
## Prerequisites
|
|
|
|
- GitHub repository with Actions enabled
|
|
- API keys for LLM providers set as repository secrets:
|
|
- `OPENAI_API_KEY` - Get from [OpenAI API keys page](https://platform.openai.com/api-keys)
|
|
- `ANTHROPIC_API_KEY` - Get from [Anthropic Console](https://console.anthropic.com/) (optional)
|
|
|
|
### Setting up GitHub Secrets:
|
|
|
|
1. Go to your repository → Settings → Secrets and variables → Actions
|
|
2. Click "New repository secret"
|
|
3. Add `OPENAI_API_KEY` with your OpenAI API key as the value
|
|
4. Repeat for other provider keys as needed
|
|
|
|
## Usage
|
|
|
|
Edit [standalone-action.yaml](./standalone-action.yaml) as needed and add it to your repository's `.github/workflows/` directory. The action will automatically run when pull requests modify prompt files.
|
|
|
|
## Expected Results
|
|
|
|
When triggered, the action will:
|
|
|
|
- Install promptfoo in the GitHub runner environment
|
|
- Run evaluations on the modified prompts
|
|
- Post results as PR comments or check results
|
|
- Fail the check if evaluations don't meet configured thresholds
|