c0ff578d1c
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
52 lines
1.8 KiB
YAML
52 lines
1.8 KiB
YAML
name: Generate Sample Outputs
|
|
|
|
# Generates real model outputs for the sample-output gallery using the
|
|
# ANTHROPIC_API_KEY repo secret — the key never leaves GitHub. Generates a
|
|
# sample for every eval-case skill that doesn't already have one (it never
|
|
# overwrites hand-written samples), rebuilds web/samples.json, and commits.
|
|
#
|
|
# Run it from the Actions tab → "Generate Sample Outputs" → Run workflow.
|
|
|
|
on:
|
|
workflow_dispatch: {}
|
|
|
|
permissions:
|
|
contents: write
|
|
pull-requests: write
|
|
|
|
jobs:
|
|
generate:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 20
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
|
|
- name: Generate missing samples + rebuild gallery
|
|
env:
|
|
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
|
|
run: |
|
|
if [ -z "$ANTHROPIC_API_KEY" ]; then
|
|
echo "::error::ANTHROPIC_API_KEY secret is not set."
|
|
exit 1
|
|
fi
|
|
node scripts/build-samples.mjs --generate-missing
|
|
|
|
# main is protected (requires PRs), so open a PR instead of pushing directly.
|
|
- name: Open a PR with the new samples
|
|
uses: peter-evans/create-pull-request@v7
|
|
with:
|
|
add-paths: |
|
|
examples/samples
|
|
web/samples.json
|
|
branch: sample-outputs
|
|
delete-branch: true
|
|
commit-message: "chore(samples): generate sample outputs for the gallery"
|
|
title: "chore(samples): generate sample outputs for the gallery"
|
|
body: |
|
|
Auto-generated by the **Generate Sample Outputs** workflow using the
|
|
ANTHROPIC_API_KEY secret. Adds real model outputs to the sample gallery
|
|
(examples.html). Hand-written samples are never overwritten.
|