Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions .github/workflows/component-fixtures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ jobs:
with:
# Need enough history for the merge-base lookup below to succeed even
# when the target branch has advanced since the PR was opened. Full
# clone would be wasteful for this large repo, so cap at 50.
fetch-depth: 50
# clone would be wasteful for this large repo, so cap at 150.
fetch-depth: 150

- name: Setup Node.js
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
Expand Down Expand Up @@ -184,8 +184,11 @@ jobs:
if [ "${{ github.event_name }}" = "pull_request" ]; then
# For PRs, diff against the merge-base with the target branch.
TARGET_REF="origin/$BASE_REF"
git fetch --no-tags --depth=50 origin "$BASE_REF"
BASE_SHA=$(git merge-base "$EVENT_SHA" "$TARGET_REF")
git fetch --no-tags --depth=150 origin "$BASE_REF"
if ! BASE_SHA=$(git merge-base "$EVENT_SHA" "$TARGET_REF"); then
echo "::warning::Unable to find a merge base between $EVENT_SHA and $TARGET_REF. The depth-150 shallow history may not contain their common ancestor; skipping screenshot comparison."
exit 0
Comment on lines +188 to +190
fi
else
# For push events, diff against the parent commit.
BASE_SHA=$(git rev-parse "$EVENT_SHA^")
Expand Down Expand Up @@ -229,6 +232,7 @@ jobs:

- name: Fetch base commit manifest
id: base_manifest
if: steps.base.outputs.base_sha != ''
env:
BASE_SHA: ${{ steps.base.outputs.base_sha }}
run: |
Expand All @@ -250,7 +254,7 @@ jobs:

- name: Diff screenshots
id: diff
if: always()
if: always() && steps.base.outputs.base_sha != ''
run: |
node build/lib/screenshotDiffReport.ts \
https://hediet-screenshots.azurewebsites.net \
Expand Down
Loading