Skip to content

VRT POC | Comment on PR #39

VRT POC | Comment on PR

VRT POC | Comment on PR #39

name: VRT POC | Comment on PR
on:
workflow_run:
workflows: ['VRT POC']
types:
- completed
env:
NX_PARALLEL: 4 # ubuntu-latest = 4-core CPU / 16 GB of RAM | macos-14-xlarge (arm) = 6-core CPU / 14 GB of RAM
NX_PREFER_TS_NODE: true
NX_VERBOSE_LOGGING: true
jobs:
run_vr_diff:
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'microsoft' }} && ${{ github.event.workflow_run.event == 'pull_request' }}
outputs:
pr_number: ${{ steps.pr_number.outputs.result }}
permissions:
pull-requests: write
contents: read
actions: read
steps:
- name: Debug
run: |
echo $W_RUN
env:
W_RUN: ${{ toJSON(github.event.workflow_run) }}
- uses: actions/download-artifact@v4
with:
name: pr-number
path: ./results
run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Load PR number
id: pr_number
run: echo "id=$(cat pr.txt)" >> $GITHUB_OUTPUT
working-directory: ./results
- name: 'Comment on PR'
uses: marocchino/sticky-pull-request-comment@773744901bac0e8cbb5a0dc842800d45e9b2b405 # v2.9.4
with:
header: vr-report-comment
number: ${{ steps.pr_number.outputs.id }}
message: |
Visual Regression Testing Report:
- status: **${{github.event.workflow_run.conclusion}}**
- 👀 check whole [report](${{github.event.workflow_run.html_url}}) to review visual differences
- 👨‍🔧 once reviewed and changes are expected, update diffs in your PR by adding a comment with following text: "/approve-visual-regression-diff"