@@ -304,6 +304,50 @@ jobs:
304304 echo "Staged artifacts for ${branch}:"
305305 find stage -type f | head -20
306306
307+ # ========================================================================
308+ # VALIDATION: CHECK FOR BROKEN LINKS (NEW CONTENT IN FULL CONTEXT)
309+ # ========================================================================
310+ # For link validation, we need the full context (existing versions) so
311+ # lychee can resolve cross-version references. So we:
312+ # 1. Build a temporary validation structure with both old and new content
313+ # 2. Run lychee only against the NEW content
314+ # 3. Clean up the temporary structure
315+ # ========================================================================
316+ - name : Build full validation context
317+ run : |
318+ branch="${{ steps.branch.outputs.branch_name }}"
319+
320+ # Build validation structure: start with existing versions
321+ mkdir -p full-context/server
322+ cp -r validation-context/server/* full-context/server/ || true
323+
324+ # Merge in the new artifacts
325+ mkdir -p "full-context/server/${branch}"
326+ cp -r "stage/${branch}/"* "full-context/server/${branch}/" || true
327+
328+ echo "Validation structure ready:"
329+ find full-context -type d -maxdepth 2
330+
331+ - name : Check for broken links with lychee
332+ uses : lycheeverse/lychee-action@8646ba30535128ac92d33dfc9133794bfdd9b411 # v2.8.0
333+ with :
334+ fail : true
335+ token : ${{ secrets.GITHUB_TOKEN }}
336+ jobSummary : true
337+ args : |
338+ --root-dir $(pwd)/full-context
339+ --offline
340+ --no-progress
341+ --remap 'https://docs.nextcloud.com/server/ file://$(pwd)/full-context/server/'
342+ --exclude 'mailto:'
343+ --exclude '(https?:/?/?)?$'
344+ --exclude-path '.*/404\.html'
345+ 'full-context/server/${{ steps.branch.outputs.branch_name }}/**/*.html'
346+
347+ - name : Clean up validation context
348+ if : always()
349+ run : rm -rf full-context
350+
307351 # ========================================================================
308352 # UPLOAD STAGING ARTIFACTS
309353 # ========================================================================
0 commit comments