Skip to content

Commit c8313c1

Browse files
authored
Bug fix: PDF invalid link.
1 parent 98ea253 commit c8313c1

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

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

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,36 @@ jobs:
133133
echo "Building Chinese site..."
134134
npx antora generate --stacktrace --to-dir ../www_publish_target/docs/cn antora-playbook-CN.yml
135135
136+
- name: Move and Rename PDF Files
137+
id: process_pdfs
138+
working-directory: ./www_publish_target
139+
run: |
140+
echo "--- Searching for PDF files to move and rename ---"
141+
142+
PDF_FILES_FOUND=$(find . -type f -path '*/_exports/index.pdf')
143+
144+
if [ -z "${PDF_FILES_FOUND}" ]; then
145+
echo "No PDF files found to move. Skipping."
146+
else
147+
echo "Found PDF files to process:"
148+
echo "${PDF_FILES_FOUND}"
149+
150+
echo "${PDF_FILES_FOUND}" | while read PDF_FILE; do
151+
# ./docs/cn/ivorysql-doc/master/_exports/index.pdf -> ./docs/cn/ivorysql-doc/master
152+
BASE_DIR="${PDF_FILE%/_exports/index.pdf}"
153+
154+
NEW_PDF_PATH="${BASE_DIR}/ivorysql.pdf"
155+
156+
echo "Moving '${PDF_FILE}' to '${NEW_PDF_PATH}'"
157+
mv "${PDF_FILE}" "${NEW_PDF_PATH}"
158+
done
159+
160+
echo "--- Cleaning up empty _exports directories ---"
161+
find . -type d -name '_exports' -empty -delete
162+
fi
163+
164+
echo "--- PDF processing complete ---"
165+
136166
- name: Commit and Push to web Repository new branch , pull request
137167
id: commit_push_new_branch
138168
working-directory: ./www_publish_target

0 commit comments

Comments
 (0)