fix(ci): pull in the upstream base repo branch for PRs

This commit is contained in:
Gabe Kangas
2026-01-02 19:54:17 -08:00
parent a278c3bb0a
commit ee3a0d486f
6 changed files with 52 additions and 3 deletions
@@ -34,6 +34,13 @@ jobs:
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0
- name: Fetch base branch for comparison
if: github.event_name == 'pull_request'
run: |
git remote add upstream https://github.com/${{ github.event.pull_request.base.repo.full_name }}.git || true
git fetch upstream ${{ github.event.pull_request.base.ref }}
- name: Check out repository code
uses: actions/checkout@v6
+7
View File
@@ -38,6 +38,13 @@ jobs:
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0
- name: Fetch base branch for comparison
if: github.event_name == 'pull_request'
run: |
git remote add upstream https://github.com/${{ github.event.pull_request.base.repo.full_name }}.git || true
git fetch upstream ${{ github.event.pull_request.base.ref }}
- name: Check out repository code
uses: actions/checkout@v6
+9 -2
View File
@@ -60,6 +60,13 @@ jobs:
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
fetch-depth: 0
- name: Fetch base branch for comparison
if: github.event_name == 'pull_request'
run: |
git remote add upstream https://github.com/${{ github.event.pull_request.base.repo.full_name }}.git || true
git fetch upstream ${{ github.event.pull_request.base.ref }}
- name: Get changed files
id: changed-files-yaml
@@ -80,9 +87,9 @@ jobs:
- name: Publish to Chromatic
if: ${{ github.actor != 'renovate[bot]' && github.actor != 'renovate' && steps.changed-files-yaml.outputs.src_any_changed == 'true' }}
uses: chromaui/action@v13
# Chromatic GitHub Action options
with:
workingDir: web
projectToken: f47410569b62
onlyChanged: true
branch: ${{ github.head_ref || github.ref_name }}
sha: ${{ github.event.pull_request.head.sha || github.sha }}
+7
View File
@@ -30,6 +30,13 @@ jobs:
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0
- name: Fetch base branch for comparison
if: github.event_name == 'pull_request'
run: |
git remote add upstream https://github.com/${{ github.event.pull_request.base.repo.full_name }}.git || true
git fetch upstream ${{ github.event.pull_request.base.ref }}
- name: Check out repository code
uses: actions/checkout@v6
+7
View File
@@ -47,6 +47,13 @@ jobs:
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0
- name: Fetch base branch for comparison
if: github.event_name == 'pull_request'
run: |
git remote add upstream https://github.com/${{ github.event.pull_request.base.repo.full_name }}.git || true
git fetch upstream ${{ github.event.pull_request.base.ref }}
- name: Check out repository code
uses: actions/checkout@v6
@@ -56,7 +56,14 @@ jobs:
if: github.event_name == 'pull_request'
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{github.event.pull_request.head.ref}}
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0
- name: Fetch base branch for comparison
if: github.event_name == 'pull_request'
run: |
git remote add upstream https://github.com/${{ github.event.pull_request.base.repo.full_name }}.git || true
git fetch upstream ${{ github.event.pull_request.base.ref }}
- name: Setup Nodejs
uses: actions/setup-node@v4
@@ -145,6 +152,13 @@ jobs:
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0
- name: Fetch base branch for comparison
if: github.event_name == 'pull_request'
run: |
git remote add upstream https://github.com/${{ github.event.pull_request.base.repo.full_name }}.git || true
git fetch upstream ${{ github.event.pull_request.base.ref }}
- name: Check out repository code
uses: actions/checkout@v6