Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel
Michael 93a93af382
docs: update GitHub Actions to v4 across documentation and examples (#5008)
1 month ago
..
5b3fcfb728
chore: Add README for missing examples (#4404)
2 months ago
93a93af382
docs: update GitHub Actions to v4 across documentation and examples (#5008)
1 month ago

README.md

You have to be logged in to leave a comment. Sign In

github-action (GitHub Action)

You can run this example with:

npx promptfoo@latest init --example 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:

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 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
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...