Skip to content

Require gh --attach for PR screenshots and videos - #222

Merged
bryanroscoe merged 2 commits into
mainfrom
ci/pr-evidence-artifacts
Oct 23, 2026
Merged

bryanroscoe merged 2 commits into
mainfrom
ci/pr-evidence-artifacts

Conversation

@bryanroscoe

@bryanroscoe bryanroscoe commented Oct 23, 2026 •

Copy link
Copy Markdown
Owner

Agent PRs linked their evidence videos by repo-relative paths (v2/evidence/…), which resolve under /pull/N/ and 404 (#213, #215, #206 and others). gh 2.99+ uploads media straight into PR bodies and comments with --attach, where GitHub renders images inline and plays videos, so CLAUDE.md (AGENTS.md is a symlink to it), CONTRIBUTING and the PR template now require that and forbid relative or branch links.

The first commit's Actions-artifact workflow was dropped in favor of this.

Evidence

  • Change type: docs/template only, non-visual.
  • Validation: posted a comment on this PR with gh pr comment 222 --attach ./launcher-feedback-simulated.webm (gh 2.103.0); it got a user-attachments URL and rendered as a video player. The test comment was then deleted.

🤖 Generated with Claude Code

Relative evidence links in PR bodies resolve under /pull/N/ and 404, so
committed videos were unreachable. A PR evidence workflow now uploads each
video unzipped, bundles the rest, and keeps one PR comment with artifact and
SHA-pinned links. workflow_dispatch backfills older PRs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-23T02:20:59.621420Z 8960b69 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@bryanroscoe

Copy link
Copy Markdown
Owner Author

End-to-end self-test on throwaway #223 (stacked on this branch with #213's evidence merged in): run 39887829108 — all three jobs green, the video artifact downloads as the original 1,948,306-byte WebM, and the sticky comment rendered with artifact, pinned and screenshot links. #223 is closed and its branch deleted.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 648722f2a2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/pr-evidence.yml Outdated
videos=$({ grep -iE '\.(webm|mp4|mov)$' evidence-files.txt || true; } \
| jq -R -s -c 'split("\n") | map(select(length > 0)) | map({
path: .,
name: (split("/") | .[-2] + "--" + .[-1])

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Derive artifact names from the full evidence path

If a PR contains videos such as v2/evidence/demo/capture.webm and v2/mobile/evidence/demo/capture.webm, both are assigned demo--capture.webm. The staging step therefore gives both files the same basename, and with archive: false the official action contract uses that basename as the artifact name and ignores the name input; one concurrent matrix upload will fail because artifact names must be unique. Include the full path or a stable hash in the generated filename so every required evidence video remains accessible.

AGENTS.md reference: AGENTS.md:L144-L144

Useful? React with 👍 / 👎.

Comment thread .github/workflows/pr-evidence.yml Outdated
needs: [collect, videos]
# Fork PRs get a read-only token, so they keep the artifacts but no comment.
if: >-
always() && needs.collect.result == 'success' && needs.collect.outputs.count != '0' &&

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Clear stale comments when the final evidence file is removed

When a later PR revision removes every evidence file, the workflow still triggers and collect reports count == 0, but this condition skips the only step that updates the existing sticky comment. The PR consequently continues displaying artifact and pinned-file links from the previous revision even though its current cumulative diff contains no evidence, which can make the repository's required evidence checklist appear satisfied incorrectly. Handle the zero-count case by deleting or replacing the existing comment with an explicit no-evidence state.

AGENTS.md reference: AGENTS.md:L144-L144

Useful? React with 👍 / 👎.

Replaces the artifact workflow: gh 2.99+ uploads media straight into PR
bodies and comments, where GitHub renders images and plays videos.
Repo-relative evidence paths 404 from a PR page.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bryanroscoe bryanroscoe changed the title Publish PR evidence videos as Actions artifacts Require gh --attach for PR screenshots and videos Oct 23, 2026
@bryanroscoe
bryanroscoe merged commit 2f963bd into main Oct 23, 2026
@bryanroscoe
bryanroscoe deleted the ci/pr-evidence-artifacts branch October 23, 2026 02:24
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.

1 participant