You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add additional troubleshooting entry for Ancestor hash not determinable
When running LHCI in GH Actions due to how checkout action clones the repo with a fetch depth of 1 by default the base branch might be missing so LH will not be able to find it during health check.
Changing the action settings and fetching the base using a new step will fix this problem for almost all cases where the repo is big enough.
This has been discussed here actions/checkout#93 and here actions/checkout#213
Copy file name to clipboardExpand all lines: docs/troubleshooting.md
+26Lines changed: 26 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -77,3 +77,29 @@ Different environments and ways of running Lighthouse will tend to see different
77
77
- Geographic location
78
78
79
79
The team does not have the bandwidth to assist with debugging this problem. Please do _not_ file an issue about it if you're unable to get scores from different environments to match.
80
+
81
+
## Running LHCI in Github Actions I constantly get Ancestor hash not determinable
82
+
83
+
If you are using `actions/checkout@v2` to checkout your repository and based on the size and traffic on your repo this error might happen due to how he checkout action is configured and is not a LHCI issue.
84
+
85
+
Checkout action by default doesn't clone the entire repo and the number of commits to fetch is set to 1 for performance reasons. When LHCI runs the health check the ancestor hash might be missing because the branch / hash is not there in the local history.
86
+
87
+
In order to fix it change / add the following:
88
+
89
+
```yml
90
+
name: Run Lighthouse tests
91
+
jobs:
92
+
lhci:
93
+
name: Lighthouse
94
+
runs-on: ubuntu-latest
95
+
steps:
96
+
- uses: actions/checkout@v2
97
+
with:
98
+
fetch-depth: 20
99
+
- name: Fetch base_ref HEAD to use it as Ancestor hash in LHCI
0 commit comments