feat(action): link the dashboard from the PR comment (Pages + hub repo publishing)#4
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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)
$GITHUB_STEP_SUMMARY, so it renders on the run page with no download at all.upload-artifact'sartifact-urloutput) when no hosted copy exists — one click to the zip instead of navigating run → artifacts.2. Same-repo Pages publishing (opt-in:
pages-branch)cubit/pr-<number>/index.htmlvia 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)wardnet/perf-reports) under<source-repo>/pr-<number>/index.html, so one Pages hub serves dashboards for many repos.pages-token(fine-grained PAT / app token with contents write on the hub) because the workflow's owngithub.tokencannot push across repos.pages-branchof the hub when set, else its default branch; fetch-rebase-retries up to 3× since concurrent publishes on a shared hub are expected.<owner>.github.iohost repos (root-domain sites);pages-urloverrides 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.