From b88e8ef171184169e26fd3ee73dce208583f63bc Mon Sep 17 00:00:00 2001 From: Christophe Bedard Date: Thu, 18 Jul 2024 19:48:01 -0400 Subject: [PATCH] Make CI create comment with link to HTML artifacts (#4564) Signed-off-by: Christophe Bedard --- .github/workflows/test.yml | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4b8250a6fa2..951f05e8c8e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -62,8 +62,30 @@ jobs: uses: actions/upload-artifact@v4 id: artifact-upload-step with: - name: html-artifacts + name: html-artifacts-${{ github.event.pull_request.number }} path: build/html retention-days: 30 # default 90 compression-level: 9 # maximum compression, default 6 if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn` + + - name: Find HTML artifacts link comment + uses: peter-evans/find-comment@v3 + id: find-comment + with: + issue-number: ${{ github.event.pull_request.number }} + comment-author: 'github-actions[bot]' + body-includes: "HTML artifacts:" + + - name: Create or update HTML artifacts link comment + uses: peter-evans/create-or-update-comment@v4 + with: + comment-id: ${{ steps.find-comment.outputs.comment-id }} + issue-number: ${{ github.event.pull_request.number }} + body: | + HTML artifacts: ${{ steps.artifact-upload-step.outputs.artifact-url }}. + + To view the resulting site: + 1. Click on the above link to download the artifacts archive + 2. Extract it + 3. Open `html-artifacts-${{ github.event.pull_request.number }}/index.html` in your favorite browser + edit-mode: replace