Skip to content

Commit bcfe663

Browse files
committed
force netlify to use local PR codes
1 parent 49bb104 commit bcfe663

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

.github/workflows/pr-preview.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,14 @@ jobs:
7575
7676
yq -i ".content.sources[0].edit_url = false" "$PLAYBOOK_FILE"
7777
78-
if [[ -n "$DETECTED_VERSION" ]]; then
78+
# Disable runtime fetch to ensure we use local files
79+
yq -i ".runtime.fetch = false" "$PLAYBOOK_FILE"
80+
81+
if [[ -n "$DETECTED_VERSION" && "$DETECTED_VERSION" != "master" ]]; then
7982
# v5.1+ uses flat structure (no version prefix in path)
8083
# v5.0 and earlier use nested structure (version prefix in path)
8184
# Use version comparison: if DETECTED_VERSION >= 5.1, use flat structure
82-
if [[ "$DETECTED_VERSION" == "master" ]]; then
83-
# Master branch uses nested structure with 'master' prefix
84-
NEW_START_PAGE="${START_PAGE_COMPONENT_NAME}:${DETECTED_VERSION}:${DETECTED_VERSION}/${START_PAGE_FILE_PATH}"
85-
elif [[ "$(printf '%s\n' "5.1" "$DETECTED_VERSION" | sort -V | head -n1)" == "5.1" ]]; then
85+
if [[ "$(printf '%s\n' "5.1" "$DETECTED_VERSION" | sort -V | head -n1)" == "5.1" ]]; then
8686
# For v5.1+: ivorysql-doc:v5.1:welcome.adoc (no version prefix in path)
8787
NEW_START_PAGE="${START_PAGE_COMPONENT_NAME}:v${DETECTED_VERSION}:${START_PAGE_FILE_PATH}"
8888
else
@@ -92,7 +92,7 @@ jobs:
9292
yq -i ".site.start_page = \"$NEW_START_PAGE\"" "$PLAYBOOK_FILE"
9393
echo "Updated .site.start_page in $PLAYBOOK_FILE to: $NEW_START_PAGE"
9494
else
95-
echo "WARNING: DETECTED_VERSION is empty. Skipping start_page update for $PLAYBOOK_FILE."
95+
echo "INFO: DETECTED_VERSION is '$DETECTED_VERSION'. Keeping original playbook start_page configuration."
9696
fi
9797
9898
yq -i ".site.title = .site.title + \" (PR Preview)\"" "$PLAYBOOK_FILE"

0 commit comments

Comments
 (0)