Repository navigation
ci: publish the evidence a borrowed-device session hands off - #1079
Merged
Merged
Conversation
Contributor
mikepitre
added this pull request to stack #1053
October 9, 2026 01:53
mikepitre
force-pushed
the
mike/verify-attach-android
branch
from
October 9, 2026 02:43
68e6c6a to
bf1ffda
Compare
mikepitre
force-pushed
the
mike/verify-attach-android
branch
from
October 9, 2026 03:58
bf1ffda to
0a0e7e6
Compare
mikepitre
force-pushed
the
mike/verify-attach-android
branch
from
October 9, 2026 05:23
0a0e7e6 to
47dfedb
Compare
mikepitre
force-pushed
the
mike/verify-attach-android
branch
from
October 9, 2026 14:52
47dfedb to
5347a9b
Compare
mikepitre
force-pushed
the
mike/verify-attach-android
branch
from
October 9, 2026 19:17
5347a9b to
6705c90
Compare
mikepitre
force-pushed
the
mike/verify-attach-android
branch
from
October 12, 2026 17:58
6705c90 to
7387011
Compare
mikepitre
force-pushed
the
mike/verify-attach-android
branch
from
October 12, 2026 19:10
7387011 to
d291296
Compare
mikepitre
force-pushed
the
mike/verify-attach-android
branch
from
October 12, 2026 20:18
d291296 to
5bd9f34
Compare
mikepitre
force-pushed
the
mike/verify-attach-android
branch
2 times, most recently
from
October 13, 2026 15:32
5bd9f34 to
2ac5104
Compare
mikepitre
force-pushed
the
mike/verify-attach-android
branch
from
October 13, 2026 16:00
2ac5104 to
9976318
Compare
mikepitre
marked this pull request as ready for review
October 13, 2026 16:05
Collaborator
|
Collaborator
|
Pushed fixes for the review findings above:
Left |
A cloud agent cannot attach a run's video and screenshots to its pull request: its sandbox refuses the upload, and the Actions token cannot attach. `verify-attach.yml` does it instead. It runs on `workflow_run` when a `verify-remote` session ends, so GitHub always runs the copy on the default branch. The job downloads the session's `verify-evidence` artifact and treats it as data. `.github/scripts/verify-attach.mjs` reads the zip itself, refuses anything outside a fixed manifest schema, file names, sizes, counts, and leading bytes, and writes only files it validated. It then edits one marked block in the description with `gh pr edit --attach`. The line it writes says that the session reported the result and links the session's run. It publishes only to the open pull request of the session's branch, in this repository, and only when the commit the session started on and the commit the run was made at are both commits of that pull request. When the pull request has moved on, the line says so. The bot token is the secret `VERIFY_EVIDENCE_TOKEN` of the environment `verify-evidence`, which allows only the default branch. A repository secret could be read by a workflow on any branch. Only the step that runs `gh` holds the token. Without the secret the job prints a notice. GitHub starts this workflow only when it and `verify-remote.yml` are both on the default branch. The runs for one branch take turns at the description, and `queue: max` keeps every run that waits. The `e2e-runner-tests` job of `android-test.yml` runs the script's tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The header of verify-attach.yml restated what the script's tests already pin: the token's environment, the permissions and the conditions of the job. The comment in the script's tests described a helper. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…he other workflows use
…t v7 This job is the only one that holds the evidence token, so its actions are pinned by commit. checkout is v7.0.1 and setup-node is v7.1.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mikepitre
force-pushed
the
mike/verify-attach-android
branch
from
October 13, 2026 22:26
9de688b to
3de9643
Compare
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
A cloud agent cannot put a run's video and screenshots on its pull request. Its sandbox refuses the upload, and the Actions token cannot attach files. So
attachin #1069 hands the files to the session's runner, which keeps them as the artifactverify-evidence. This PR adds the workflow that reads that artifact and puts the evidence in the pull request description, with a bot token.It is the fifth PR of the stack and sits on #1069, which sits on #1052, #1046, and #1041. GitHub starts the workflow only from the copy on
main. So it does nothing until this PR has merged, which is after the rest of the stack.One commit.
.github/workflows/verify-attach.ymlworkflow_runwhen averify-remotesession ends, from the default branch..github/scripts/verify-attach.mjsgh pr edit --attach..github/scripts/verify-attach.test.mjs.github/workflows/android-test.ymle2e-runner-testsjob.The script is the same file, byte for byte, in clerk/clerk-ios and clerk/javascript. Review it once.
runandattachreplaces the block.<!-- verify-evidence:android -->and<!-- /verify-evidence:android -->. Everything outside it is kept as it was, with the line endings the description has. The workflow refuses a description that has neither comment and ends inside a code fence that never closes.queue: maxkeeps every run that waits.The environment
verify-evidenceexists in this repository and allows onlymain. It holds the secretVERIFY_EVIDENCE_TOKEN, a fine-grained token of a machine account that is limited to this repository and has "Pull requests: read and write". There is no repository secret of that name, and there must not be one.A repository secret can be read by a workflow that anyone with write access adds on any branch. A secret of an environment that allows only
maincannot. Without the secret the job prints a notice and publishes nothing.What to focus on
actions: readandcontents: read, and only the step that runsghholds the token. Check that nothing from the artifact or the branch can reach that step.pullRequestMismatchandcommitNotListed.verify-remotesession, with or without evidence, and each start shows as a deployment toverify-evidence.node --test .github/scripts/verify-attach.test.mjspasses 143 of 143. Every rule has a test with an input that is refused.actionlintreports one finding in the new workflow, thequeuekey, which the installed version does not know.Not proven, and not provable before the stack is on
main:gh pr edit --attach.verify-evidenceartifact. The script was run against zips made on a Mac.queue: maxkeeps every waiting run in this workflow.Screenshots / video
None. The change has no screen.
🤖 Generated with Claude Code
Summary by CodeRabbit