Skip to content

Commit

Permalink
[CI] Do not rewrite links in symlinked files (ukri-excalibur#305)
Browse files Browse the repository at this point in the history
If we rewrite the hyperlinks in symlinked files we risk to accidentally append
duplicate `${PREVIEW_SUBDIR}`, depending on the order with which `find` operates
on the files.
  • Loading branch information
giordano authored Apr 10, 2024
1 parent 174d94b commit 47da51d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ jobs:
echo "BASE_URL=${BASE_URL}" >> "${GITHUB_ENV}"
PREVIEW_SUBDIR="preview/PR${{ github.event.number }}"
echo "PREVIEW_SUBDIR=${PREVIEW_SUBDIR}" >> "${GITHUB_ENV}"
find . -name '*.md' -print -exec sed -i "s|${BASE_URL}|${BASE_URL}/${PREVIEW_SUBDIR}|g" '{}' \;
# Edit only files, and not symlinks, to avoid double editing the same files.
find . -type f -name '*.md' -print -exec sed -i "s|${BASE_URL}|${BASE_URL}/${PREVIEW_SUBDIR}|g" '{}' \;
- name: Build docs
run: |
Expand Down

0 comments on commit 47da51d

Please sign in to comment.