Repository navigation
Action: one sticky PR comment, opt-in comment: true - #94
Merged
Merged
Conversation
Posts the verdict and compact output as one PR comment, found by a per-artifact-name marker and edited on later runs. Works on pull_request and deployment_status; warns instead of failing on a read-only token. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Merged
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.
What / why
New
commentinput (default"false"). Withcomment: "true"the action posts the verdict, the left/right line, links to the run and the artifact, and the compact output as one PR comment, and edits that same comment on every later run instead of stacking new ones. The comment starts with<!-- renderdiff:<artifact-name> -->, so two runs in one job (which already need distinctartifact-names) keep separate comments. Output over 60 000 bytes is cut on a line boundary (no split UTF-8, fence always closes) with a link to the full job summary.Permissions
The job needs
pull-requests: write(documented with apermissions:block in docs/github-action.md). Uses the defaultgithub.tokenandgh, preinstalled on GitHub-hosted runners.Behaviour
pull_request: comments on that PR.deployment_status: looks up the open PR for the deployed commit (commits/{sha}/pulls, open only).push/ no open PR: notice, comment skipped.gh, any API error: a warning; the step never fails the job, and the result stays in the job summary. Docs warn against switching topull_request_target.github-actions[bot]and starting with the marker, so a human quoting it isn't edited.Self-test
.github/workflows/action.ymlsetsRENDERDIFF_COMMENT_DRY_RUN=1for the job (an undocumented test hook) and runs thediffercase withcomment: "true": it builds the body and does the read-only lookup of existing comments, then prints the POST/PATCH it would send. The final check asserts the body file has the marker and/color.Tested locally
bash -non the extracted step scripts (shellcheck not installed).RUNNER_TEMP/GITHUB_*env: push with no PR (notice, exit 0);deployment_statuson main's merge sha (merged PR ignored, skipped); dry run against PR Release 0.10.0 #90 (read-only GET, printsPOST .../issues/90/comments); bad token (warning, exit 0); a 2000-line multibyte log (body 60 196 bytes, valid UTF-8, fence closed on its own line, truncation note); small log with artifact URL.runstep on the bad-input path: job summary output unchanged.npm run typecheck,lint,format:check,npm test,npm run test:visualpass.Fixes #44
🤖 Generated with Claude Code