Repository navigation
Commit 22cdcc4
Link a semantic diff page on each pull request
When a pull request is opened, reopened or pushed, the Semantic Diff
workflow renders its commits with scripts/commitRecords.js, uploads the page
to the CDN at semantic-diff/pr-<N>/index.html, and keeps one comment on the
pull request with its link. The link carries the rendered head commit as a
query string. Closing the pull request deletes the page. A pull request
from a branch of this repository runs on pull_request, with its own
workflow and renderer, from its first push and on any base branch. A pull
request from a fork runs on pull_request_target.
Security: pull_request_target takes the workflow from the default branch
and runs it with the repository's secrets, so for forks the job runs only
the default branch's code. It checks out the base commit without persisted
credentials, fetches refs/pull/<N>/head as git objects, and renders them
with the base branch's renderer, which reads git data and escapes all text
it writes into the page. Each pull request runs on one of the two events:
the jobs compare the event with the head repository, and the concurrency
group names the event.
Review: Why the CDN and not GitHub Pages? Pages here is one deployment from
master (the dev playground) that each deploy replaces whole; the CDN
already holds the playground's per-pull-request bundles under
dev-playground-bundles/pr-<N>/.
Area: ci docs
Changelog: none
Output: unchanged
Ran: Semantic Diff run on #8870 (render ok; upload needs
--s3-no-check-bucket, as the playground upload uses); dry run of the render step in a fresh blob:none clone of
rescript-lang/rescript against refs/pull/8862/head (page written, both
checks pass); YAML parse (ok, both triggers and job
conditions read back); upload, comment and cleanup steps run only on
GitHub
PR: #8870
Signed-off-by: Cristiano Calcagno <cristianoc@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>1 parent df9c4e0 commit 22cdcc4
2 files changed
Lines changed: 107 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
0 commit comments