@@ -57,6 +57,15 @@ outputs:
5757 tests_output :
5858 description : Full output of the test runner
5959 value : ${{ steps.tests.outputs.output }}
60+ comment_path :
61+ description : >
62+ Path to a file containing the rendered Markdown PR comment body.
63+ Empty when no integration directories changed. Useful for callers
64+ that want to upload the comment as an artifact and post it from a
65+ separate workflow (e.g. workflow_run) — typically required for
66+ pull requests opened from forks, where the pull_request event
67+ runs with a read-only GITHUB_TOKEN.
68+ value : ${{ steps.render.outputs.path }}
6069
6170runs :
6271 using : composite
@@ -176,6 +185,38 @@ runs:
176185 fi
177186 exit $EXIT_CODE
178187
188+ - name : Render comment markdown
189+ id : render
190+ if : always() && steps.detect.outputs.dirs != ''
191+ shell : bash
192+ env :
193+ HEAD_SHA : ${{ github.event.pull_request.head.sha }}
194+ SERVER_URL : ${{ github.server_url }}
195+ REPOSITORY : ${{ github.repository }}
196+ COMMIT_MSG : ${{ steps.detect.outputs.commit_msg }}
197+ UPDATED_AT : ${{ github.event.pull_request.updated_at }}
198+ DIRS : ${{ steps.detect.outputs.dirs }}
199+ STRUCTURE_OUTCOME : ${{ steps.structure.outcome }}
200+ STRUCTURE_WARN : ${{ steps.structure.outputs.has_warnings }}
201+ STRUCTURE_OUTPUT : ${{ steps.structure.outputs.output }}
202+ CODE_OUTCOME : ${{ steps.code.outcome }}
203+ CODE_WARN : ${{ steps.code.outputs.has_warnings }}
204+ CODE_OUTPUT : ${{ steps.code.outputs.output }}
205+ TESTS_OUTCOME : ${{ steps.tests.outcome }}
206+ TESTS_WARN : ${{ steps.tests.outputs.has_warnings }}
207+ TESTS_OUTPUT : ${{ steps.tests.outputs.output }}
208+ README_OUTCOME : ${{ steps.readme.outcome }}
209+ README_WARN : ${{ steps.readme.outputs.has_warnings }}
210+ README_OUTPUT : ${{ steps.readme.outputs.output }}
211+ VERSION_OUTCOME : ${{ steps.version.outcome }}
212+ VERSION_WARN : ${{ steps.version.outputs.has_warnings }}
213+ VERSION_OUTPUT : ${{ steps.version.outputs.output }}
214+ run : |
215+ set -euo pipefail
216+ OUT="${{ runner.temp }}/validation-comment.md"
217+ python "${{ github.action_path }}/scripts/render_comment.py" > "$OUT"
218+ echo "path=$OUT" >> "$GITHUB_OUTPUT"
219+
179220 - name : Delete stale PR comment
180221 if : always() && steps.detect.outputs.dirs == '' && inputs.post_comment == 'true'
181222 uses : marocchino/sticky-pull-request-comment@v2
@@ -188,61 +229,7 @@ runs:
188229 uses : marocchino/sticky-pull-request-comment@v2
189230 with :
190231 header : validation-results
191- message : |
192- ## 🔍 Integration Validation Results
193-
194- **Commit:** [`${{ github.event.pull_request.head.sha }}`](${{ github.server_url }}/${{ github.repository }}/commit/${{ github.event.pull_request.head.sha }}) · ${{ steps.detect.outputs.commit_msg }}
195- **Updated:** ${{ github.event.pull_request.updated_at }}
196-
197- **Changed directories:** `${{ steps.detect.outputs.dirs }}`
198-
199- | Check | Result |
200- |-------|--------|
201- | Structure | ${{ steps.structure.outcome == 'failure' && '❌ Failed' || (steps.structure.outputs.has_warnings == 'true' && '⚠️ Passed with warnings' || '✅ Passed') }} |
202- | Code | ${{ steps.code.outcome == 'failure' && '❌ Failed' || (steps.code.outputs.has_warnings == 'true' && '⚠️ Passed with warnings' || '✅ Passed') }} |
203- | Tests | ${{ steps.tests.outcome == 'failure' && '❌ Failed' || (steps.tests.outputs.has_warnings == 'true' && '⚠️ Passed with warnings' || '✅ Passed') }} |
204- | README | ${{ steps.readme.outcome == 'failure' && '❌ Failed' || (steps.readme.outputs.has_warnings == 'true' && '⚠️ Passed with warnings' || '✅ Passed') }} |
205- | Version | ${{ steps.version.outcome == 'failure' && '❌ Failed' || (steps.version.outputs.has_warnings == 'true' && '⚠️ Passed with warnings' || '✅ Passed') }} |
206-
207- <details><summary>${{ steps.structure.outcome == 'failure' && '❌' || (steps.structure.outputs.has_warnings == 'true' && '⚠️' || '✅') }} Structure Check output</summary>
208-
209- ```
210- ${{ steps.structure.outputs.output }}
211- ```
212-
213- </details>
214-
215- <details><summary>${{ steps.code.outcome == 'failure' && '❌' || (steps.code.outputs.has_warnings == 'true' && '⚠️' || '✅') }} Code Check output</summary>
216-
217- ```
218- ${{ steps.code.outputs.output }}
219- ```
220-
221- </details>
222-
223- <details><summary>${{ steps.tests.outcome == 'failure' && '❌' || (steps.tests.outputs.has_warnings == 'true' && '⚠️' || '✅') }} Tests output</summary>
224-
225- ```
226- ${{ steps.tests.outputs.output }}
227- ```
228-
229- </details>
230-
231- <details><summary>${{ steps.readme.outcome == 'failure' && '❌' || (steps.readme.outputs.has_warnings == 'true' && '⚠️' || '✅') }} README Check output</summary>
232-
233- ```
234- ${{ steps.readme.outputs.output }}
235- ```
236-
237- </details>
238-
239- <details><summary>${{ steps.version.outcome == 'failure' && '❌' || (steps.version.outputs.has_warnings == 'true' && '⚠️' || '✅') }} Version Check output</summary>
240-
241- ```
242- ${{ steps.version.outputs.output }}
243- ```
244-
245- </details>
232+ path : ${{ steps.render.outputs.path }}
246233
247234 - name : Fail if any check failed
248235 if : always() && (steps.structure.outcome == 'failure' || steps.code.outcome == 'failure' || steps.tests.outcome == 'failure' || steps.readme.outcome == 'failure' || steps.version.outcome == 'failure')
0 commit comments