Add PR comment step to codex-preview workflow - #239
Merged
Conversation
Posts per-page preview links (or a blanket fallback for snippet/CSV-only PRs) as a PR comment after a successful Codex deploy, matching the behaviour already present in docs-deploy.yml. - Per-page links: strips docs/ prefix and .md extension, links to https://codex.elastic.dev${PATH_PREFIX}/${path} - Snippet/CSV-only PRs: posts a blanket comment with the index URL - No docs changes: comment step is skipped (deploy.result != success) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
reakaleek
reviewed
Jul 22, 2026
Co-authored-by: Jan Calanog <jan.calanog@elastic.co>
reakaleek
reviewed
Jul 22, 2026
Address review feedback: the check job already has the list of changed files via tj-actions/changed-files. Expose all_changed_files as a job output, pass it to comment via env var, and split on spaces instead of paginating the pulls.listFiles API. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
reakaleek
approved these changes
Jul 22, 2026
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.
Why
The
codex-preview.ymlworkflow builds and deploys a preview on every PR, but never posts a comment with links — contributors have to hunt for the deployment URL themselves. Jan noted this was a natural follow-up after #238 landed.What
Adds a
commentjob that runs after a successfuldeploy:## 🔍 Preview links for changed Codex pages, linking tohttps://codex.elastic.dev${PATH_PREFIX}/${path}.deployis skipped →commentcondition (needs.deploy.result == 'success') is false → no comment.The comment is upserted (update if a bot comment with the same title exists, create otherwise), so re-runs don't spam the PR.
Test plan
_snippets/→ blanket fallback comment appears🤖 Generated with Claude Code