Skip to content

feat(action): link the dashboard from the PR comment (Pages + hub repo publishing)#4

Merged
pedromvgomes merged 2 commits into
mainfrom
claude/pr-report-distribution-8vy4eq
Jul 20, 2026
Merged

feat(action): link the dashboard from the PR comment (Pages + hub repo publishing)#4
pedromvgomes merged 2 commits into
mainfrom
claude/pr-report-distribution-8vy4eq

Conversation

@pedromvgomes

@pedromvgomes pedromvgomes commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

The HTML dashboard was only reachable by opening the action run, downloading the report artifact zip, and unzipping it. This gives the sticky PR comment a one-click path to the dashboard, in three tiers that degrade gracefully:

Changes

1. Job summary + direct artifact link (always on)

  • The report is mirrored to $GITHUB_STEP_SUMMARY, so it renders on the run page with no download at all.
  • The PR comment links the artifact's direct download URL (upload-artifact's artifact-url output) when no hosted copy exists — one click to the zip instead of navigating run → artifacts.

2. Same-repo Pages publishing (opt-in: pages-branch)

  • Publishes each PR's dashboard to a branch of the consuming repo under cubit/pr-<number>/index.html via a git worktree (orphan-created on first use) and links the hosted page from the comment.

3. Central hub repo publishing (opt-in: pages-repo + pages-token)

  • Publishes to a separate host repo (e.g. wardnet/perf-reports) under <source-repo>/pr-<number>/index.html, so one Pages hub serves dashboards for many repos.
  • Needs pages-token (fine-grained PAT / app token with contents write on the hub) because the workflow's own github.token cannot push across repos.
  • Pushes to pages-branch of the hub when set, else its default branch; fetch-rebase-retries up to 3× since concurrent publishes on a shared hub are expected.
  • URL derivation special-cases <owner>.github.io host repos (root-domain sites); pages-url overrides for custom domains.

Failure behavior

Publishing is strictly best-effort and never gates the job: fork PRs (read-only token / no secrets), missing branches, clone or push failures all log a note to stderr and fall back to the artifact link tier.

Testing

All publish paths were exercised against local bare repos standing in for origin/hub: first-publish orphan creation, multi-repo hub layout, identical-content re-runs, missing token, nonexistent hub branch, root-domain URL derivation, a rejected-then-retried push, and same-repo worktree mode regression.

claude added 2 commits July 20, 2026 04:55
The HTML dashboard was only reachable by navigating to the action run and
downloading the report artifact zip. Give the comment a one-click path:

- Opt-in `pages-branch` input publishes each PR's dashboard to a Pages
  branch under cubit/pr-<number>/index.html and links the hosted page from
  the comment. Best-effort: fork PRs (read-only token) fall back cleanly.
- Without Pages, the comment links the artifact's direct download URL
  (upload-artifact's artifact-url output) instead of nothing.
- Mirror the report to the job summary so it renders on the run page with
  no download at all.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KSfzG1jqR2VyRaBKxG19DX
New pages-repo input points publishing at a separate host repository
(e.g. wardnet/perf-reports) instead of a branch in the source repo:

- Dashboards land under <source-repo>/pr-<number>/index.html, so one hub
  serves many repos; the comment links the hosted page.
- Requires the new pages-token input (github.token cannot push across
  repos). Empty token — e.g. a fork PR, where secrets are absent — falls
  back to the artifact link, as does any clone/push failure.
- Pushes to pages-branch of the hub when set, else its default branch,
  creating the branch as an orphan if it does not exist yet.
- Concurrent publishes on a shared hub are expected, so the push
  fetch-rebase-retries up to 3 times.
- URL derivation special-cases <owner>.github.io host repos, which serve
  from the root domain rather than /<repo>/.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KSfzG1jqR2VyRaBKxG19DX
@pedromvgomes
pedromvgomes merged commit b73700c into main Jul 20, 2026
2 checks passed
@pedromvgomes
pedromvgomes deleted the claude/pr-report-distribution-8vy4eq branch July 20, 2026 05:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants