Improve README contribution checks (#327)

* Stabilize README link checks

* Enforce README entry ordering

* Ignore CI-blocked lib.rs links
This commit is contained in:
David Gasquez authored and GitHub committed 2026-08-08 11:03:46 +02:00
1 parent 16b7d79974
commit 009e09359b
6 files changed
+177 -62

No files matched your search

+40 -25
View File
@@ -1,31 +1,46 @@
name: Check links in the README
name: Check the README
on: [push, pull_request]
on:
push:
branches: [main]
paths:
- README.md
- .github/lychee.toml
- .github/scripts/check-readme-order.mjs
- .github/workflows/linkchecker.yml
pull_request:
paths:
- README.md
- .github/lychee.toml
- .github/scripts/check-readme-order.mjs
- .github/workflows/linkchecker.yml
workflow_dispatch:
permissions:
contents: read
concurrency:
group: link-check-${{ github.ref }}
cancel-in-progress: true
jobs:
LinkChecker:
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Check entry order
if: github.event_name == 'pull_request'
env:
BASE_REF: ${{ github.base_ref }}
run: |
git fetch --no-tags --depth=1 origin "$BASE_REF"
git show FETCH_HEAD:README.md > "$RUNNER_TEMP/README.base.md"
node .github/scripts/check-readme-order.mjs "$RUNNER_TEMP/README.base.md" README.md
- name: Check links
uses: lycheeverse/lychee-action@e7477775783ea5526144ba13e8db5eec57747ce8 # v2.9.0
with:
fetch-depth: 0
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: pandoc
- name: Convert Markdown to HTML format
run: pandoc README.md --standalone --output README.html
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: '3.9'
- run: pip install linkchecker --user
- name: Link Checker
run: linkchecker README.html --config .github/linkchecker/linkchecker.conf --file-output html/utf-8/report.html
- run: cat report.html >> ${GITHUB_STEP_SUMMARY}
if: success() || failure()
args: --config .github/lychee.toml README.md
lycheeVersion: v0.24.2