From 451b7f429414bedeb0e363b474c9b43429c48045 Mon Sep 17 00:00:00 2001 From: Darius Jahandarie Date: Mon, 27 Mar 2023 20:31:38 +0900 Subject: Fix error in playwright_comment --- .github/workflows/playwright_comment.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/playwright_comment.yml b/.github/workflows/playwright_comment.yml index 8c33b618..9b068f56 100644 --- a/.github/workflows/playwright_comment.yml +++ b/.github/workflows/playwright_comment.yml @@ -21,7 +21,7 @@ jobs: id: playwright-output with: github_token: ${{ secrets.GITHUB_TOKEN }} - run-id: ${{ github.event.workflow_run.id }} + run_id: ${{ github.event.workflow_run.id }} name: playwright-output - name: Grab master-screenshots-outcome from PR run @@ -30,7 +30,7 @@ jobs: id: master-screenshots-outcome with: github_token: ${{ secrets.GITHUB_TOKEN }} - run-id: ${{ github.event.workflow_run.id }} + run_id: ${{ github.event.workflow_run.id }} name: master-screenshots-outcome - name: Load artifacts into environment variables -- cgit v1.2.3 From 1a6d5b93f2f92dc02dada4809d43579be710d74e Mon Sep 17 00:00:00 2001 From: Darius Jahandarie Date: Thu, 30 Mar 2023 15:33:16 +0900 Subject: Fix more errors in playwright_comment --- .github/workflows/playwright_comment.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/playwright_comment.yml b/.github/workflows/playwright_comment.yml index 9b068f56..429adf3d 100644 --- a/.github/workflows/playwright_comment.yml +++ b/.github/workflows/playwright_comment.yml @@ -18,7 +18,6 @@ jobs: - name: Grab playwright-output from PR run uses: dawidd6/action-download-artifact@5e780fc7bbd0cac69fc73271ed86edf5dcb72d67 # pin@v2 continue-on-error: true - id: playwright-output with: github_token: ${{ secrets.GITHUB_TOKEN }} run_id: ${{ github.event.workflow_run.id }} @@ -27,7 +26,6 @@ jobs: - name: Grab master-screenshots-outcome from PR run uses: dawidd6/action-download-artifact@5e780fc7bbd0cac69fc73271ed86edf5dcb72d67 # pin@v2 continue-on-error: true - id: master-screenshots-outcome with: github_token: ${{ secrets.GITHUB_TOKEN }} run_id: ${{ github.event.workflow_run.id }} @@ -40,18 +38,21 @@ jobs: echo "PLAYWRIGHT_OUTPUT<<$EOF" >> $GITHUB_OUTPUT cat ./playwright-output >> $GITHUB_OUTPUT echo "$EOF" >> $GITHUB_OUTPUT + echo "MASTER_SCREENSHOTS_OUTCOME<<$EOF" >> $GITHUB_OUTPUT + cat ./master-screenshots-outcome >> $GITHUB_OUTPUT + echo "$EOF" >> $GITHUB_OUTPUT echo "NUM_FAILED=$(grep -c 'Screenshot comparison failed' $GITHUB_OUTPUT)" >> $GITHUB_OUTPUT - name: "[Comment] Couldn't download screenshots from master branch" uses: mshick/add-pr-comment@a65df5f64fc741e91c59b8359a4bc56e57aaf5b1 # pin@v2 - if: github.event_name == 'pull_request' && steps.master-screenshots-outcome == 'failure' + if: github.event_name == 'pull_request' && steps.playwright.outputs.MASTER_SCREENSHOTS_OUTCOME == 'failure' with: message: | :heavy_exclamation_mark: Could not fetch screenshots from master branch, so had nothing to make a visual comparison against; please check the "master-screenshots" step in the workflow run and rerun it before merging. - name: "[Comment] Success: No visual differences introduced by this PR" uses: mshick/add-pr-comment@a65df5f64fc741e91c59b8359a4bc56e57aaf5b1 # pin@v2 - if: github.event_name == 'pull_request' && steps.master-screenshots-outcome != 'failure' && steps.playwright.outputs.NUM_FAILED == 0 + if: github.event_name == 'pull_request' && steps.playwright.outputs.MASTER_SCREENSHOTS_OUTCOME != 'failure' && steps.playwright.outputs.NUM_FAILED == 0 with: message: | :heavy_check_mark: No visual differences introduced by this PR. @@ -59,7 +60,7 @@ jobs: - name: "[Comment] Warning: Visual differences introduced by this PR" uses: mshick/add-pr-comment@a65df5f64fc741e91c59b8359a4bc56e57aaf5b1 # pin@v2 - if: github.event_name == 'pull_request' && steps.master-screenshots-outcome != 'failure' && steps.playwright.outputs.NUM_FAILED != 0 + if: github.event_name == 'pull_request' && steps.playwright.outputs.MASTER_SCREENSHOTS_OUTCOME != 'failure' && steps.playwright.outputs.NUM_FAILED != 0 with: message: | :warning: ${{ steps.playwright.outputs.NUM_FAILED }} visual differences introduced by this PR; please validate if they are desirable. -- cgit v1.2.3 From e4933770d0e2b021258885d04445d21527330f5d Mon Sep 17 00:00:00 2001 From: Darius Jahandarie Date: Thu, 30 Mar 2023 15:43:24 +0900 Subject: Continue to fix playwright_comment --- .github/workflows/playwright_comment.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/playwright_comment.yml b/.github/workflows/playwright_comment.yml index 429adf3d..7e88b80e 100644 --- a/.github/workflows/playwright_comment.yml +++ b/.github/workflows/playwright_comment.yml @@ -45,14 +45,14 @@ jobs: - name: "[Comment] Couldn't download screenshots from master branch" uses: mshick/add-pr-comment@a65df5f64fc741e91c59b8359a4bc56e57aaf5b1 # pin@v2 - if: github.event_name == 'pull_request' && steps.playwright.outputs.MASTER_SCREENSHOTS_OUTCOME == 'failure' + if: steps.playwright.outputs.MASTER_SCREENSHOTS_OUTCOME == 'failure' with: message: | :heavy_exclamation_mark: Could not fetch screenshots from master branch, so had nothing to make a visual comparison against; please check the "master-screenshots" step in the workflow run and rerun it before merging. - name: "[Comment] Success: No visual differences introduced by this PR" uses: mshick/add-pr-comment@a65df5f64fc741e91c59b8359a4bc56e57aaf5b1 # pin@v2 - if: github.event_name == 'pull_request' && steps.playwright.outputs.MASTER_SCREENSHOTS_OUTCOME != 'failure' && steps.playwright.outputs.NUM_FAILED == 0 + if: steps.playwright.outputs.MASTER_SCREENSHOTS_OUTCOME != 'failure' && steps.playwright.outputs.NUM_FAILED == 0 with: message: | :heavy_check_mark: No visual differences introduced by this PR. @@ -60,7 +60,7 @@ jobs: - name: "[Comment] Warning: Visual differences introduced by this PR" uses: mshick/add-pr-comment@a65df5f64fc741e91c59b8359a4bc56e57aaf5b1 # pin@v2 - if: github.event_name == 'pull_request' && steps.playwright.outputs.MASTER_SCREENSHOTS_OUTCOME != 'failure' && steps.playwright.outputs.NUM_FAILED != 0 + if: steps.playwright.outputs.MASTER_SCREENSHOTS_OUTCOME != 'failure' && steps.playwright.outputs.NUM_FAILED != 0 with: message: | :warning: ${{ steps.playwright.outputs.NUM_FAILED }} visual differences introduced by this PR; please validate if they are desirable. -- cgit v1.2.3 From 5903a1079166ef4645412846b6c52a16f9173e83 Mon Sep 17 00:00:00 2001 From: Darius Jahandarie Date: Thu, 30 Mar 2023 15:56:18 +0900 Subject: Continue fixing playwright_comment --- .github/workflows/playwright_comment.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/playwright_comment.yml b/.github/workflows/playwright_comment.yml index 7e88b80e..ccb0f4cf 100644 --- a/.github/workflows/playwright_comment.yml +++ b/.github/workflows/playwright_comment.yml @@ -47,6 +47,7 @@ jobs: uses: mshick/add-pr-comment@a65df5f64fc741e91c59b8359a4bc56e57aaf5b1 # pin@v2 if: steps.playwright.outputs.MASTER_SCREENSHOTS_OUTCOME == 'failure' with: + issue: ${{ github.event.workflow_run.pull_requests[0].number }} message: | :heavy_exclamation_mark: Could not fetch screenshots from master branch, so had nothing to make a visual comparison against; please check the "master-screenshots" step in the workflow run and rerun it before merging. @@ -54,6 +55,7 @@ jobs: uses: mshick/add-pr-comment@a65df5f64fc741e91c59b8359a4bc56e57aaf5b1 # pin@v2 if: steps.playwright.outputs.MASTER_SCREENSHOTS_OUTCOME != 'failure' && steps.playwright.outputs.NUM_FAILED == 0 with: + issue: ${{ github.event.workflow_run.pull_requests[0].number }} message: | :heavy_check_mark: No visual differences introduced by this PR. [View Playwright Report](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.event.workflow_run.id }}#artifacts) (note: open the "playwright-report" artifact) @@ -62,6 +64,7 @@ jobs: uses: mshick/add-pr-comment@a65df5f64fc741e91c59b8359a4bc56e57aaf5b1 # pin@v2 if: steps.playwright.outputs.MASTER_SCREENSHOTS_OUTCOME != 'failure' && steps.playwright.outputs.NUM_FAILED != 0 with: + issue: ${{ github.event.workflow_run.pull_requests[0].number }} message: | :warning: ${{ steps.playwright.outputs.NUM_FAILED }} visual differences introduced by this PR; please validate if they are desirable.
-- cgit v1.2.3 From 46dd7a261d23a1f8f124a3a459be1ed3e3bec1ff Mon Sep 17 00:00:00 2001 From: Darius Jahandarie Date: Thu, 30 Mar 2023 17:55:45 +0900 Subject: Continue fixing playwright_comment --- .github/workflows/playwright_comment.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/playwright_comment.yml b/.github/workflows/playwright_comment.yml index ccb0f4cf..6b50631d 100644 --- a/.github/workflows/playwright_comment.yml +++ b/.github/workflows/playwright_comment.yml @@ -43,11 +43,19 @@ jobs: echo "$EOF" >> $GITHUB_OUTPUT echo "NUM_FAILED=$(grep -c 'Screenshot comparison failed' $GITHUB_OUTPUT)" >> $GITHUB_OUTPUT + # this is required because github.event.workflow_run.pull_requests is not available for PRs from forks + - name: "Get PR information" + uses: potiuk/get-workflow-origin@e2dae063368361e4cd1f510e8785cd73bca9352e # pin@v1_5 + id: source-run-info + with: + token: ${{ secrets.GITHUB_TOKEN }} + sourceRunId: ${{ github.event.workflow_run.id }} + - name: "[Comment] Couldn't download screenshots from master branch" uses: mshick/add-pr-comment@a65df5f64fc741e91c59b8359a4bc56e57aaf5b1 # pin@v2 if: steps.playwright.outputs.MASTER_SCREENSHOTS_OUTCOME == 'failure' with: - issue: ${{ github.event.workflow_run.pull_requests[0].number }} + issue: ${{ steps.source-run-info.outputs.pullRequestNumber }} message: | :heavy_exclamation_mark: Could not fetch screenshots from master branch, so had nothing to make a visual comparison against; please check the "master-screenshots" step in the workflow run and rerun it before merging. @@ -55,7 +63,7 @@ jobs: uses: mshick/add-pr-comment@a65df5f64fc741e91c59b8359a4bc56e57aaf5b1 # pin@v2 if: steps.playwright.outputs.MASTER_SCREENSHOTS_OUTCOME != 'failure' && steps.playwright.outputs.NUM_FAILED == 0 with: - issue: ${{ github.event.workflow_run.pull_requests[0].number }} + issue: ${{ steps.source-run-info.outputs.pullRequestNumber }} message: | :heavy_check_mark: No visual differences introduced by this PR. [View Playwright Report](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.event.workflow_run.id }}#artifacts) (note: open the "playwright-report" artifact) @@ -64,7 +72,7 @@ jobs: uses: mshick/add-pr-comment@a65df5f64fc741e91c59b8359a4bc56e57aaf5b1 # pin@v2 if: steps.playwright.outputs.MASTER_SCREENSHOTS_OUTCOME != 'failure' && steps.playwright.outputs.NUM_FAILED != 0 with: - issue: ${{ github.event.workflow_run.pull_requests[0].number }} + issue: ${{ steps.source-run-info.outputs.pullRequestNumber }} message: | :warning: ${{ steps.playwright.outputs.NUM_FAILED }} visual differences introduced by this PR; please validate if they are desirable.
-- cgit v1.2.3