From 87b6670b9419e603eae50162f4cd2192afdbd796 Mon Sep 17 00:00:00 2001 From: "beeps (Kim Grey)" Date: Tue, 5 Sep 2023 16:03:38 +0100 Subject: [PATCH 1/2] Set Percy target branch Modify GitHub actions config so that Percy runs comparisons with the PR's target branch as the base, rather than always using 'main'. --- .github/workflows/screenshots.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/screenshots.yml b/.github/workflows/screenshots.yml index 5a3a1318f8..efec1ea846 100644 --- a/.github/workflows/screenshots.yml +++ b/.github/workflows/screenshots.yml @@ -15,6 +15,7 @@ jobs: env: PERCY_PARALLEL_NONCE: ${{ github.run_id }}-${{ github.run_attempt }} + PERCY_TARGET_BRANCH: ${{ github.base_ref }} PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }} # Skip when secrets are unavailable on forks From 97838f0b09ec54a3502c67d118cfb663325f2cf9 Mon Sep 17 00:00:00 2001 From: "beeps (Kim Grey)" Date: Tue, 5 Sep 2023 17:25:41 +0100 Subject: [PATCH 2/2] Pin Percy to latest commit on the target branch --- .github/workflows/screenshots.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/screenshots.yml b/.github/workflows/screenshots.yml index efec1ea846..be661d4a00 100644 --- a/.github/workflows/screenshots.yml +++ b/.github/workflows/screenshots.yml @@ -15,7 +15,8 @@ jobs: env: PERCY_PARALLEL_NONCE: ${{ github.run_id }}-${{ github.run_attempt }} - PERCY_TARGET_BRANCH: ${{ github.base_ref }} + PERCY_TARGET_BRANCH: ${{ github.event.pull_request.base.ref }} + PERCY_TARGET_COMMIT: ${{ github.event.pull_request.base.sha }} PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }} # Skip when secrets are unavailable on forks