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.)
411name : GitGlimpse Demo
512
613on :
@@ -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
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
0 commit comments