Skip to content

Fix AsciiDoc xref links and restructure commands to flat /references/ directory #22

Fix AsciiDoc xref links and restructure commands to flat /references/ directory

Fix AsciiDoc xref links and restructure commands to flat /references/ directory #22

Workflow file for this run

name: links
on:
push:
branches:
- main
pull_request:
jobs:
link_checker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3'
bundler-cache: true
- name: Build site
env:
JEKYLL_ENV: production
run: bundle exec jekyll build --trace
- name: Restore lychee cache
uses: actions/cache@v4
with:
path: .lycheecache
key: cache-lychee-${{ github.sha }}
restore-keys: cache-lychee-
- name: Check if site was built
run: |
if [ ! -d "_site" ]; then
echo "Error: _site directory not created"
exit 1
fi
echo "Site built successfully"
ls -la _site/
- name: Link Checker (Built Site)
uses: lycheeverse/lychee-action@v2
with:
# Check the built HTML site for rendered links
# Set base URL to _site directory for Jekyll baseurl resolution
args: >-
--verbose \
--no-progress \
--config lychee.toml \
--root-dir "$(pwd)/_site" \
--base-url file://${{ github.workspace }}/_site \
'_site/**/*.html'
fail: true
output: link-check-results.md
format: markdown
- name: Upload link check results
if: always()
uses: actions/upload-artifact@v4
with:
name: link-check-results
path: |
link-check-results.md
retention-days: 30
- name: Comment PR with results
if: failure() && github.event_name == 'pull_request'
uses: actions/github-script@v7
with:
script: |
const fs = require('fs');
let comment = '## 🔗 Link Check Failed\n\n';
if (fs.existsSync('link-check-results.md')) {
const results = fs.readFileSync('link-check-results.md', 'utf8');
comment += '### Built Site Results\n\n' + results + '\n\n';
}
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: comment
});