aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/playwright_comment.yml
diff options
context:
space:
mode:
authorDarius Jahandarie <djahandarie@gmail.com>2023-03-30 17:55:45 +0900
committerDarius Jahandarie <djahandarie@gmail.com>2023-03-30 17:56:37 +0900
commit46dd7a261d23a1f8f124a3a459be1ed3e3bec1ff (patch)
treec87702fe9d0e082261165e3565e45180c02f6dd1 /.github/workflows/playwright_comment.yml
parent5903a1079166ef4645412846b6c52a16f9173e83 (diff)
Continue fixing playwright_comment
Diffstat (limited to '.github/workflows/playwright_comment.yml')
-rw-r--r--.github/workflows/playwright_comment.yml14
1 files 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.
<details>