Skip to content

Commit 3d77841

Browse files
committed
Merge branch 'main' of http://127.0.0.1:39015/git/DeDuckProject/git-glimpse into claude/fix-mobile-gif-preview-DP7gy
2 parents 4607c0d + a0ad4b6 commit 3d77841

12 files changed

Lines changed: 1108 additions & 99 deletions

File tree

.github/workflows/demo.yml

Lines changed: 35 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
# GitGlimpse E2E Demo Workflow
22
# Runs the action against a local example app on every PR.
33
# Safe: no untrusted user input (PR titles/bodies) is used in run: commands.
4+
#
5+
# ⚠️ IMPORTANT — changes to this file only take effect after merging to main.
6+
#
7+
# GitHub always reads issue_comment workflows from the default branch (main),
8+
# so edits to this file on a feature branch are silently ignored when /glimpse
9+
# is triggered. To test a workflow change: merge to main first, then re-run.
10+
# (Action/core code changes are fine on branches — they are rebuilt from source.)
411
name: GitGlimpse Demo
512

613
on:
@@ -21,20 +28,14 @@ jobs:
2128
permissions:
2229
pull-requests: write
2330
contents: write
31+
issues: write
2432

2533
steps:
2634
- uses: actions/checkout@v4
2735
with:
2836
fetch-depth: 0
2937
ref: ${{ github.event_name == 'issue_comment' && format('refs/pull/{0}/head', github.event.issue.number) || '' }}
3038

31-
# On issue_comment we check out the PR head (for app code), but need
32-
# the action from main (which has trigger support). The bundled dist
33-
# includes all core logic, so restoring just packages/action/ suffices.
34-
- name: Use latest action code from main
35-
if: github.event_name == 'issue_comment'
36-
run: git checkout origin/main -- packages/action/
37-
3839
- uses: pnpm/action-setup@v4
3940

4041
- uses: actions/setup-node@v4
@@ -45,6 +46,12 @@ jobs:
4546
- name: Install dependencies
4647
run: pnpm install
4748

49+
# Always build from source so the action dist matches the checked-out code.
50+
# This ensures /glimpse on a PR branch uses that branch's action/core code,
51+
# not whatever was last committed to dist or published to main.
52+
- name: Build action from source
53+
run: pnpm build
54+
4855
# Check whether the pipeline should run before installing heavy dependencies.
4956
# Subsequent steps are gated on this output to skip ffmpeg/Playwright when
5057
# the trigger config (on-demand, smart, etc.) decides to skip the run.
@@ -93,3 +100,24 @@ jobs:
93100
env:
94101
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
95102
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
103+
104+
- name: React with hooray on success
105+
if: >-
106+
github.event_name == 'issue_comment' &&
107+
steps.check.outputs.should-run == 'true' &&
108+
success()
109+
env:
110+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
111+
run: |
112+
gh api repos/$GITHUB_REPOSITORY/issues/comments/${{ github.event.comment.id }}/reactions \
113+
--method POST --field content=hooray || true
114+
115+
- name: React with confused on failure
116+
if: >-
117+
github.event_name == 'issue_comment' &&
118+
failure()
119+
env:
120+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
121+
run: |
122+
gh api repos/$GITHUB_REPOSITORY/issues/comments/${{ github.event.comment.id }}/reactions \
123+
--method POST --field content=confused || true

.github/workflows/glimpse-ack.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# GitGlimpse Acknowledge Workflow
2+
#
3+
# OPTIONAL — this workflow is not required for git-glimpse to work.
4+
# The demo pipeline runs and posts its comment regardless of whether
5+
# this file exists.
6+
#
7+
# What it does: reacts with 👀 on the /glimpse comment as soon as a
8+
# runner is available (~15–30s), giving the commenter immediate visual
9+
# confirmation that their request was received — before the heavy
10+
# pipeline steps begin.
11+
#
12+
# Why it's a separate file: keeping it separate from the main workflow
13+
# means it never shows up as a "skipped" check on pull_request events.
14+
# If it were in the same file as the demo job, GitHub would show an
15+
# "ack (skipped)" entry in the PR checks on every push — noise for
16+
# non-developer reviewers.
17+
#
18+
# ⚠️ Changes only take effect after merging to main (GitHub reads
19+
# issue_comment workflows from the default branch).
20+
name: GitGlimpse Acknowledge
21+
22+
on:
23+
issue_comment:
24+
types: [created]
25+
26+
jobs:
27+
ack:
28+
if: >-
29+
github.event.issue.pull_request != null &&
30+
contains(github.event.comment.body, '/glimpse')
31+
runs-on: ubuntu-latest
32+
permissions:
33+
issues: write
34+
steps:
35+
- name: React with eyes
36+
env:
37+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
run: |
39+
gh api repos/$GITHUB_REPOSITORY/issues/comments/${{ github.event.comment.id }}/reactions \
40+
--method POST --field content=eyes || true

CLAUDE.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,22 @@ pnpm test --watch # watch mode
4949

5050
Integration tests require a running app. See `tests/integration/`.
5151

52+
## External-First Design Principle
53+
54+
git-glimpse is used as a GitHub Action (and in future possibly a GitHub App) by *other* repos —
55+
not just this one. Every change we make must account for the experience of those consumers.
56+
57+
**Rules of thumb:**
58+
- **Seamless by default**: aim for zero-config or minimal-config integration that just works.
59+
- **Control when needed**: if seamless isn't achievable (e.g. workflow-level changes), provide
60+
clear documentation, sample workflow snippets, and ideally a wrapper action.
61+
- **No silent breakage**: changes to action inputs/outputs, config schema, or workflow events must
62+
be backwards-compatible or clearly versioned.
63+
- **Test from the outside**: validate features as if you were a consumer repo, not just via this
64+
repo's internal `demo.yml`.
65+
- **Discuss trade-offs**: if a feature requires consumers to make non-trivial changes (new secrets,
66+
new workflow jobs, new permissions), flag it in the PR for a deliberate decision.
67+
5268
## Branching Convention
5369

5470
- Features: `feat/<name>`

0 commit comments

Comments
 (0)