Skip to content

Commit fc3ed3d

Browse files
committed
Allow to pass custom LHCI config
The path of the custom config file is not yet configurable and needs to be .github/lighthouserc-custom.yml.
1 parent 0ba9164 commit fc3ed3d

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

entrypoint.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ query_string="?_fd=0&pb=0"
167167
min_score_performance="${LHCI_MIN_SCORE_PERFORMANCE:-0.6}"
168168
min_score_accessibility="${LHCI_MIN_SCORE_ACCESSIBILITY:-0.9}"
169169

170+
# Prepare the default CI Lighthouse config
170171
cat <<- EOF > lighthouserc.yml
171172
ci:
172173
collect:
@@ -195,6 +196,11 @@ ci:
195196
aggregationMethod: median-run
196197
EOF
197198

199+
# Merge custom Lighthouse CI config, if provided
200+
if [[ -f ".github/lighthouserc-custom.yml" ]]; then
201+
yq eval-all 'select(fileIndex == 0) * select(fileIndex == 1)' lighthouserc.yml .github/lighthouserc-custom.yml -i
202+
fi
203+
198204
cat <<-EOF > setPreviewCookies.js
199205
module.exports = async (browser) => {
200206
// launch browser for LHCI

0 commit comments

Comments
 (0)