Skip to content

Commit 32cc436

Browse files
committed
change the entrance path to the latest branch
1 parent 3195ce1 commit 32cc436

File tree

1 file changed

+4
-20
lines changed

1 file changed

+4
-20
lines changed

.github/workflows/merge-build-push.yml

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -84,16 +84,8 @@ jobs:
8484
echo # Newline for better readability
8585
8686
if [[ -n "$DETECTED_VERSION" ]]; then
87-
# v5.1+ uses flat structure (no version prefix in path)
88-
# v5.0 and earlier use nested structure (version prefix in path)
89-
# Use version comparison: if DETECTED_VERSION >= 5.1, use flat structure
90-
if [[ "$(printf '%s\n' "5.1" "$DETECTED_VERSION" | sort -V | head -n1)" == "5.1" ]]; then
91-
# For v5.1+: ivorysql-doc:v5.1:welcome.adoc (no version prefix in path)
92-
NEW_START_PAGE="${START_PAGE_COMPONENT_NAME}:v${DETECTED_VERSION}:${START_PAGE_FILE_PATH}"
93-
else
94-
# For v5.0 and earlier: ivorysql-doc:v5.0:v5.0/welcome.adoc (with version prefix)
95-
NEW_START_PAGE="${START_PAGE_COMPONENT_NAME}:v${DETECTED_VERSION}:v${DETECTED_VERSION}/${START_PAGE_FILE_PATH}"
96-
fi
87+
# All branches use flat structure (single-level path): ivorysql-doc:v5.1:welcome.adoc
88+
NEW_START_PAGE="${START_PAGE_COMPONENT_NAME}:v${DETECTED_VERSION}:${START_PAGE_FILE_PATH}"
9789
yq -i ".site.start_page = \"$NEW_START_PAGE\"" "$PLAYBOOK_FILE"
9890
echo "Updated .site.start_page in $PLAYBOOK_FILE to: $NEW_START_PAGE"
9991
else
@@ -143,16 +135,8 @@ jobs:
143135
144136
TARGET_BRANCH="v${LATEST_VERSION}"
145137
146-
# v5.1+ uses flat structure (single-level path)
147-
# v5.0 and earlier use nested structure (double-level path)
148-
# Use version comparison: if LATEST_VERSION >= 5.1, use flat structure
149-
if [[ "$(printf '%s\n' "5.1" "$LATEST_VERSION" | sort -V | head -n1)" == "5.1" ]]; then
150-
# For v5.1+: ivorysql-doc/v5.1/welcome.html (single-level)
151-
EXPECTED_PATH="ivorysql-doc/v${LATEST_VERSION}/welcome.html"
152-
else
153-
# For v5.0 and earlier: ivorysql-doc/v5.0/v5.0/welcome.html (double-level)
154-
EXPECTED_PATH="ivorysql-doc/v${LATEST_VERSION}/v${LATEST_VERSION}/welcome.html"
155-
fi
138+
# All versions use flat structure (single-level path): ivorysql-doc/v5.1/welcome.html
139+
EXPECTED_PATH="ivorysql-doc/v${LATEST_VERSION}/welcome.html"
156140
157141
if [[ "${MERGED_PR_BASE}" != "${TARGET_BRANCH}" ]]; then
158142
echo "Base branch ${MERGED_PR_BASE} is not the latest version branch ${TARGET_BRANCH}, skip index redirect check."

0 commit comments

Comments
 (0)