Skip to content

✅ test: Add comprehensive test suite for codebase (#30) #146

✅ test: Add comprehensive test suite for codebase (#30)

✅ test: Add comprehensive test suite for codebase (#30) #146

Workflow file for this run

name: Update Prompts and Views
on:
push:
paths:
- ".github/workflows/**/*.yml"
- "prompts/**/*.md"
- "prompts/prompt.md"
- "src/app/**/*.ts"
- "src/system_prompts/**/*.md"
- "src/app/templates/*.md"
jobs:
update_views:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Validate critical files
run: |
if [ ! -f "src/system_prompts/prompt_analysis_agent/prompt.md" ]; then
echo "Error: AI prompt analyzer file is missing"
exit 1
fi
- name: Check environment
run: |
if [ -z "$ANTHROPIC_API_KEY" ]; then
echo "Error: ANTHROPIC_API_KEY is not set"
exit 1
fi
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Lint TypeScript files
run: npm run lint
- name: Type check
run: npm run type-check
- name: Run tests
run: npm test
- name: Validate YAML files
run: npm run validate-yaml
- name: Check for system prompt changes
id: check_changes
run: |
if git diff --name-only HEAD^ HEAD | grep -q "src/system_prompts/prompt_analysis_agent/"; then
echo "FORCE_REGENERATE=true" >> $GITHUB_ENV
else
echo "FORCE_REGENERATE=false" >> $GITHUB_ENV
fi
- name: Update metadata files
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
FORCE_REGENERATE: ${{ env.FORCE_REGENERATE }}
CLI_ENV: ci
run: npm run update-metadata
- name: Update views
run: npm run update-views
- name: Generate TOC
run: npm run toc
- name: Commit changes
run: |
git config --local user.name "github-actions[bot]"
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add prompts/
git add README.md
git status
git diff --staged --name-status
git commit -m "♻️ chore: Update metadata and views" || echo "No changes to commit"
git push