Skip to content

Commit 11269a2

Browse files
taylorarndtCopilot
andcommitted
Add generate-diagram-svgs workflow to auto-generate SVGs on script change
Runs scripts/generate-diagram-svgs.py on push to main whenever the script is updated, commits any new/changed SVGs back to the repo. Supports workflow_dispatch for manual re-generation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 43f97b9 commit 11269a2

1 file changed

Lines changed: 41 additions & 0 deletions

File tree

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Generate Diagram SVGs
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
paths:
7+
- 'scripts/generate-diagram-svgs.py'
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: write
12+
13+
jobs:
14+
generate:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
token: ${{ secrets.GITHUB_TOKEN }}
22+
23+
- name: Set up Python
24+
uses: actions/setup-python@v5
25+
with:
26+
python-version: '3.x'
27+
28+
- name: Generate SVGs
29+
run: python scripts/generate-diagram-svgs.py
30+
31+
- name: Commit and push SVGs
32+
run: |
33+
git config user.name "github-actions[bot]"
34+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
35+
git add docs/images/*.svg
36+
if [ -n "$(git status --porcelain)" ]; then
37+
git commit -m "chore: regenerate diagram SVGs from script"
38+
git push
39+
else
40+
echo "No SVG changes to commit"
41+
fi

0 commit comments

Comments
 (0)