Skip to content

Commit 3fac40e

Browse files
Add GitGlimpse workflow for automated demo recording (#41)
* feat: integrate git-glimpse for automated PR demo generation Adds GitGlimpse GitHub Action to automatically record and post visual demo GIFs of UI changes on pull requests. Includes: - .github/workflows/git-glimpse.yml: main pipeline triggered on PR push or /glimpse comment; installs deps, records demo, posts to PR - .github/workflows/git-glimpse-ack.yml: fast acknowledgment workflow that reacts with 👀 emoji when /glimpse is triggered - git-glimpse.config.ts: project config pointing to Vite dev server at http://localhost:5173/epp-demo/ Requires ANTHROPIC_API_KEY secret set in repository settings. https://claude.ai/code/session_01L74tc3msNfg2KcEuUef4Wf * chore: explicitly set git-glimpse trigger mode to auto https://claude.ai/code/session_01L74tc3msNfg2KcEuUef4Wf * Revert "chore: explicitly set git-glimpse trigger mode to auto" This reverts commit afacd24. --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 872c3d3 commit 3fac40e

3 files changed

Lines changed: 93 additions & 0 deletions

File tree

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: GitGlimpse Acknowledge
2+
3+
on:
4+
issue_comment:
5+
types: [created]
6+
7+
jobs:
8+
ack:
9+
if: >-
10+
github.event.issue.pull_request != null &&
11+
contains(github.event.comment.body, '/glimpse')
12+
runs-on: ubuntu-latest
13+
permissions:
14+
issues: write
15+
steps:
16+
- name: React with eyes
17+
env:
18+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19+
run: |
20+
gh api repos/$GITHUB_REPOSITORY/issues/comments/${{ github.event.comment.id }}/reactions \
21+
--method POST --field content=eyes || true

.github/workflows/git-glimpse.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: GitGlimpse
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize]
6+
issue_comment:
7+
types: [created]
8+
9+
jobs:
10+
demo:
11+
runs-on: ubuntu-latest
12+
if: >-
13+
github.event_name == 'pull_request' ||
14+
(github.event_name == 'issue_comment' &&
15+
github.event.issue.pull_request != null &&
16+
contains(github.event.comment.body, '/glimpse'))
17+
permissions:
18+
pull-requests: write
19+
contents: write
20+
issues: write
21+
22+
steps:
23+
- uses: actions/checkout@v4
24+
with:
25+
fetch-depth: 0
26+
ref: ${{ github.event_name == 'issue_comment' && format('refs/pull/{0}/head', github.event.issue.number) || '' }}
27+
28+
- uses: actions/setup-node@v4
29+
with:
30+
node-version: '20'
31+
32+
- run: npm ci
33+
34+
- name: Install FFmpeg
35+
run: sudo apt-get install -y ffmpeg
36+
37+
- name: Install Playwright Chromium
38+
run: npx playwright install chromium --with-deps
39+
40+
- uses: DeDuckProject/git-glimpse@v1
41+
env:
42+
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
43+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+
45+
- name: React with hooray on success
46+
if: github.event_name == 'issue_comment' && success()
47+
env:
48+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49+
run: |
50+
gh api repos/$GITHUB_REPOSITORY/issues/comments/${{ github.event.comment.id }}/reactions \
51+
--method POST --field content=hooray || true
52+
53+
- name: React with confused on failure
54+
if: github.event_name == 'issue_comment' && failure()
55+
env:
56+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57+
run: |
58+
gh api repos/$GITHUB_REPOSITORY/issues/comments/${{ github.event.comment.id }}/reactions \
59+
--method POST --field content=confused || true

git-glimpse.config.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import type { GitGlimpseConfig } from '@git-glimpse/core';
2+
3+
export default {
4+
app: {
5+
startCommand: 'npm run dev',
6+
readyWhen: { url: 'http://localhost:5173/epp-demo/' },
7+
},
8+
recording: {
9+
format: 'gif',
10+
maxDuration: 30,
11+
viewport: { width: 1280, height: 720 },
12+
},
13+
} satisfies GitGlimpseConfig;

0 commit comments

Comments
 (0)