ci: use actual base

This commit is contained in:
Acid Chicken (硫酸鶏) 2023-05-18 14:16:07 +09:00
parent dd60f1a533
commit 6bb82cda37
No known key found for this signature in database
GPG key ID: 3E87B98A3F6BAB99

View file

@ -28,7 +28,10 @@ jobs:
ref: "refs/pull/${{ github.event.number }}/merge"
- name: Checkout actual HEAD
if: github.event_name == 'pull_request_target'
run: git checkout $(git rev-list --parents -n1 HEAD | cut -d" " -f3)
id: rev
run: |
echo "base=$(git rev-list --parents -n1 HEAD | cut -d" " -f2)" >> $GITHUB_OUTPUT
git checkout $(git rev-list --parents -n1 HEAD | cut -d" " -f3)
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
@ -75,7 +78,7 @@ jobs:
if: github.event_name == 'pull_request_target'
id: chromatic_pull_request
run: |
DIFF="${{ github.base_ref }} HEAD"
DIFF="${{ steps.rev.outputs.base }} HEAD"
if [ "$DIFF" = "0000000000000000000000000000000000000000 HEAD" ]; then
DIFF="HEAD"
fi