diff --git a/.github/workflows/development.yml b/.github/workflows/development.yml index 6c8b4d1752c..1f339e8df09 100644 --- a/.github/workflows/development.yml +++ b/.github/workflows/development.yml @@ -202,6 +202,8 @@ jobs: uses: ./.github/workflows/vrt.yml with: skip: ${{ contains(github.event.pull_request.labels.*.name, 'skip_vrt') }} + ref: ${{ github.event.pull_request.head.ref || github.ref_name }} + sha: ${{ github.event.pull_request.head.sha || github.ref }} secrets: inherit # ------------------------------------------------------------- diff --git a/.github/workflows/production.yml b/.github/workflows/production.yml index a3dd475efdf..e77c66e48d0 100644 --- a/.github/workflows/production.yml +++ b/.github/workflows/production.yml @@ -53,6 +53,8 @@ jobs: uses: ./.github/workflows/vrt.yml with: skip: ${{ github.base_ref != 'main' }} + ref: ${{ github.ref_name }} + sha: ${{ github.ref }} secrets: inherit # ------------------------------------------------------------- diff --git a/.github/workflows/vrt.yml b/.github/workflows/vrt.yml index cf91938aa74..7d7a4368e0f 100644 --- a/.github/workflows/vrt.yml +++ b/.github/workflows/vrt.yml @@ -15,6 +15,16 @@ on: required: false type: boolean default: false + ref: + description: "Branch to test" + required: false + type: string + default: ${{ github.ref }} + sha: + description: "SHA to test" + required: false + type: string + default: ${{ github.ref }} outputs: storybook-url: description: "URL of the published Storybook" @@ -37,6 +47,11 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 + ref: ${{ inputs.ref || github.ref }} + env: + CHROMATIC_BRANCH: ${{ inputs.ref || github.ref_name }} + CHROMATIC_SHA: ${{ inputs.sha || github.ref }} + CHROMATIC_SLUG: ${{ github.repository }} - name: Use Node LTS version uses: actions/setup-node@v4 @@ -79,7 +94,6 @@ jobs: onlyChanged: true traceChanged: true untraced: ".github/* plugins/stylelint-*/* tools/* .changeset/*" - diagnostics: true autoAcceptChanges: "main" # Lets VRT pass without running so as not to waste snapshots skip: ${{ inputs.skip }}