Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Validate external URLs in CI using Lychee #392

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,28 @@ on:
- completed

jobs:
validate-urls:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install lychee
run: cargo install lychee

- name: Check external links
id: check_links
run: lychee --verbose --exclude-mail --no-progress ./**/*.md | tee lychee-output.txt

- name: Fail CI if broken links exist
run: |
if grep -q "🚫" lychee-output.txt; then
echo "❌ Broken links found! CI is failing."
exit 1
fi

maven-cd:
needs: validate-urls
uses: jenkins-infra/github-reusable-workflows/.github/workflows/maven-cd.yml@v1
secrets:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/link-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Validate External Links

on:
pull_request:
push:
branches:
- main

jobs:
link-check:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Install lychee
run: cargo install lychee

- name: Run lychee to check links
id: lychee_check
run: lychee --verbose --exclude-mail --no-progress ./**/*.md | tee lychee-output.txt

- name: Fail CI if broken links exist
run: |
if grep -q "🚫" lychee-output.txt; then
echo "Broken links found! CI is failing."
exit 1
fi
Loading