-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (51 loc) · 1.75 KB
/
update_views.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: Update Views and Metadata
on:
push:
paths:
- "prompts/prompt.md"
- "prompts/*/prompt.md"
- ".github/templates/*.md"
- ".github/prompts/**/*.md"
- ".github/scripts/*.py"
jobs:
update_views:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12.6"
cache: "pip"
cache-dependency-path: ".github/scripts/requirements.txt"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r .github/scripts/requirements.txt
- name: Check for system prompt changes
id: check_changes
run: |
if git diff --name-only HEAD^ HEAD | grep -q ".github/prompts/ai_prompt_analyzer_and_output_generator/"; then
echo "FORCE_REGENERATE=true" >> $GITHUB_ENV
else
echo "FORCE_REGENERATE=false" >> $GITHUB_ENV
fi
- name: Generate metadata
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
FORCE_REGENERATE: ${{ env.FORCE_REGENERATE }}
run: python .github/scripts/generate_metadata.py
- name: Update views
run: python .github/scripts/update_views.py
- 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