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

Automatic broken link checking #360

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
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
51 changes: 51 additions & 0 deletions .github/workflows/link-checker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Link Checker

on:
repository_dispatch:
workflow_dispatch:
schedule:
- cron: "00 18 * * *"

jobs:
linkChecker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4


- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.1'
bundler-cache: true
cache-version: 0


- name: Install dependencies
run: |
bundle install

- name: Build with Jekyll
# Outputs to the './_site' directory by default
run: |
bundle exec jekyll build
env:
PAGES_REPO_NWO: ${{ github.repository }}
JEKYLL_BUILD_BRANCH: ${{ github.ref_name }}
JEKYLL_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Link Checker
id: lychee
uses: lycheeverse/lychee-action@v1
with:
# Check all markdown, html and reStructuredText files in repo (default)
args: _site/
# Don't fail action on broken links
fail: false

# Create or Update the issue based on the link check result
- name: Update Comment From File
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: 2531398005
body-path: ./lychee/out.md
Loading