Commit fcbe0c5
committed
fix(ci): split Docs AI Review comment into workflow_run workflow
Pull requests from forks run pull_request workflows with a read-only
GITHUB_TOKEN regardless of declared permissions, so the inline comment
step could never post on fork PRs and returned 403 on both GraphQL
and REST comment endpoints. Split the flow following the GitHub
workflow_run pattern:
- docs-ai-review.yml (pull_request trigger) now only prepares the
packet and uploads it as an artifact, together with a pr-metadata
JSON describing the PR number, head SHA, base SHA and trigger name.
It no longer tries to comment.
- docs-ai-review-comment.yml (workflow_run trigger on the first
workflow) downloads the artifact from the completed run, parses the
metadata, and upserts the advisory comment via REST. Because
workflow_run runs in the base-repo context, its GITHUB_TOKEN honors
the declared issues: write permission even for fork-originated PRs.
The comment workflow does not check out or execute any code from the
fork. It only consumes the prebuilt packet and metadata JSON, which
avoids the security footgun usually associated with giving write
permissions to fork-triggered runs.1 parent 49a74d6 commit fcbe0c5
1 file changed
Lines changed: 0 additions & 61 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
0 commit comments