From 4b895ae451c056bb4cbdee23f83886db1308e195 Mon Sep 17 00:00:00 2001 From: mxkae Date: Wed, 5 Feb 2025 20:08:22 +0800 Subject: [PATCH] fix PR comment --- .github/workflows/playwright.yml | 33 ++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 30388f227..15c489ff1 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -34,15 +34,28 @@ jobs: WP_PASSWORD: password STACKABLE_SLUG: Stackable/plugin run: npm run test - - name: Zip Playwright Report - uses: montudor/action-zip@v1 + - uses: actions/upload-artifact@v4 + if: ${{ !cancelled() }} with: - args: zip -qq -r playwright-report-${{ env.VERSION_SUFFIX }}.zip playwright-report - - name: Upload Playwright report artifact - if: ${{ github.event_name == 'pull_request' }} - uses: gavv/pull-request-artifacts@v1.0.0 + name: playwright-report-${{ env.VERSION_SUFFIX }}.zip + path: playwright-report/ + retention-days: 30 + - name: Find Comment + uses: peter-evans/find-comment@v3 + id: fc with: - commit: ${{ github.event.pull_request.head.sha }} - repo-token: ${{ secrets.GITHUB_TOKEN }} - artifacts: playwright-report-${{ env.VERSION_SUFFIX }}.zip - artifacts-branch: artifacts + issue-number: ${{ github.event.pull_request.number }} + comment-author: 'github-actions[bot]' + body-includes: Playwright Report Artifact + - name: Create or update comment + uses: peter-evans/create-or-update-comment@v4 + with: + comment-id: ${{ steps.fc.outputs.comment-id }} + issue-number: ${{ github.event.pull_request.number }} + body: | + ` ## Playwright Report Artifact + | file | commit | + | ---- | ------ | + | [playwright-report-${{ env.VERSION_SUFFIX }}.zip](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts) | ${{ github.sha }} | + ` + edit-mode: replace