Skip to content

Add GitHub Action with sticky PR report comments - #7

Merged
joneja09 merged 3 commits into
masterfrom
cursor/github-action-pr-results-3ba8
Aug 26, 2026
Merged

Add GitHub Action with sticky PR report comments#7
joneja09 merged 3 commits into
masterfrom
cursor/github-action-pr-results-3ba8

Conversation

@joneja09

@joneja09 joneja09 commented Aug 26, 2026

Copy link
Copy Markdown
Owner

Recommendation

Rename the GitHub repo to ci-html-viewer: yes, when you are ready. It matches a multi-platform tool. I cannot rename it from here (gh is read-only). Do it in GitHub Settings; clone URLs will change. Keep the Azure DevOps extension id (html-report-portal) so existing installs keep working. action.yml is already at the repo root, so after a rename the action becomes joneja09/ci-html-viewer@v1.

GitHub Actions version: yes. Azure has a build-result tab; GitHub does not. The action publishes the same HTML reports to the job summary and as artifacts.

Apply results on the PR: we were not doing that before. This change does:

  • Sticky PR comment (<!-- ci-html-viewer:Name -->) with pass/fail per HTML file, updated on re-runs instead of stacking comments
  • Job summary on the workflow run
  • Artifact with inlined HTML (and a zip of the original folder when report-dir is a directory)

Should the PR comment link to the HTML file?

Yes. GitHub comments are markdown only, so the report itself cannot be embedded, and an artifact URL is a zip download rather than a page you can open.

This update publishes the inlined HTML to GitHub Pages (gh-pages, path pr/{number}/{artifact-name}/) and turns each report name into a link:

  • [newman-pass.html](https://<owner>.github.io/<repo>/pr/7/Fixture-Reports/newman-pass.html)
  • Open HTML report for the listing or index.html

The Pages push is best-effort (continue-on-error). If it fails, the comment still posts pass/fail plus a workflow artifacts link, without broken HTML URLs.

Enable Settings → Pages → Deploy from a branch → gh-pages once so those links render. Until that is set, HTML links may 404.

The job that uses the action needs:

permissions:
  contents: write       # push HTML preview to gh-pages
  pull-requests: write  # sticky PR comment

Usage

permissions:
  contents: write
  pull-requests: write

- uses: joneja09/azure-pipelines-html-viewer@v1
  if: always()
  with:
    report-dir: reports
    name: Test Reports
    fail-on-failed-reports: true

Set pages-preview: false to skip the Pages deploy and keep filename-only comments.

Note on #6

This branch is based on #6 (asset inlining / zip / fail-on-failed-reports). Merging this PR includes that work. If #6 is merged first, this PR shrinks to the GitHub Action files.

Testing

  • Helper unit tests for comment markdown, Pages URLs, generated index.html listings, and prepareReports
  • Local smoke of github-action/render-comment.js producing clickable HTML links
  • CI dogfoods the action against the Newman fixtures and should update this PR's sticky comment
Open in Web Open in Cursor 

cursoragent and others added 2 commits August 26, 2026 14:10
Coverage-style HTML folders did not render in the pipeline tab because
only the HTML files were uploaded. Local CSS/JS/images are now inlined,
a zip of the original directory is attached for Download all, and
failOnFailedReports can fail the task after publish.

Co-authored-by: Jeff Jones <joneja09@users.noreply.github.com>
GitHub has no build-result tab, so the action writes a job summary,
uploads artifacts, and posts a sticky PR comment with pass/fail for
each HTML file. Azure Pipelines support is unchanged.

Co-authored-by: Jeff Jones <joneja09@users.noreply.github.com>
@github-actions

github-actions Bot commented Aug 26, 2026

Copy link
Copy Markdown

Fixture Reports

1 failed, 3 passed (4 reports)

Report Result
generic.html ✅ passed
nested/deep/report.htm ✅ passed
newman-fail.html ❌ failed
newman-pass.html ✅ passed

Open HTML report · Workflow artifacts
A zip of the original report folder is included in the Fixture-Reports artifact. If an HTML link 404s, set GitHub Pages source to the gh-pages branch.

@joneja09
joneja09 marked this pull request as ready for review August 26, 2026 14:29
GitHub comments cannot embed HTML, and workflow artifacts are zip downloads.
Publish inlined reports to gh-pages at pr/{number}/{artifact}/ and turn each
table row into a clickable HTML link after a successful preview deploy.

Co-authored-by: Jeff Jones <joneja09@users.noreply.github.com>
@joneja09
joneja09 merged commit 4a4a8fb into master Aug 26, 2026
2 checks passed
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