|
1 | 1 | # GitGlimpse E2E Demo Workflow |
2 | 2 | # Runs the action against a local example app on every PR. |
3 | 3 | # 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.) |
4 | 11 | name: GitGlimpse Demo |
5 | 12 |
|
6 | 13 | on: |
|
28 | 35 | fetch-depth: 0 |
29 | 36 | ref: ${{ github.event_name == 'issue_comment' && format('refs/pull/{0}/head', github.event.issue.number) || '' }} |
30 | 37 |
|
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 | | - |
38 | 38 | - uses: pnpm/action-setup@v4 |
39 | 39 |
|
40 | 40 | - uses: actions/setup-node@v4 |
|
45 | 45 | - name: Install dependencies |
46 | 46 | run: pnpm install |
47 | 47 |
|
| 48 | + # Always build from source so the action dist matches the checked-out code. |
| 49 | + # This ensures /glimpse on a PR branch uses that branch's action/core code, |
| 50 | + # not whatever was last committed to dist or published to main. |
| 51 | + - name: Build action from source |
| 52 | + run: pnpm build |
| 53 | + |
48 | 54 | # Check whether the pipeline should run before installing heavy dependencies. |
49 | 55 | # Subsequent steps are gated on this output to skip ffmpeg/Playwright when |
50 | 56 | # the trigger config (on-demand, smart, etc.) decides to skip the run. |
|
93 | 99 | env: |
94 | 100 | ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} |
95 | 101 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
96 | | - GG_DEBUG_TRACE: '1' |
97 | | - |
98 | | - - name: Upload Playwright trace |
99 | | - if: always() && steps.check.outputs.should-run == 'true' |
100 | | - uses: actions/upload-artifact@v4 |
101 | | - with: |
102 | | - name: playwright-trace |
103 | | - path: ./recordings/trace.zip |
104 | | - if-no-files-found: ignore |
0 commit comments