Skip to content

Broken Link Checker #405

Broken Link Checker

Broken Link Checker #405

# Copyright the Hyperledger Fabric contributors. All rights reserved.
#
# SPDX-License-Identifier: Apache-2.0
name: "Broken Link Checker"
on:
workflow_dispatch:
schedule:
- cron: "50 1 * * *"
pull_request:
paths:
- .github/workflows/broken-link-checker.yml
permissions:
contents: read
jobs:
broken-lint-checker:
# Only run the scheduled job in hyperledger/fabric repository, not on personal forks
if: github.event_name != 'schedule' || (github.event_name == 'schedule' && github.repository == 'hyperledger/fabric')
name: "Check for Broken Links"
runs-on: ${{ github.repository == 'hyperledger/fabric' && 'fabric-ubuntu-22.04' || 'ubuntu-22.04' }}
steps:
- name: Checkout Fabric Code
uses: actions/checkout@v4
- name: Check Broken Links with Muffet
# Exclude any links that direct to the documentation or release notes of the non-latest version to limit the scanning to target to that of the latest version.
run: |
docker run raviqqe/muffet:2.11.0 \
--max-response-body-size=100000000 \
--header="User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36" \
--header="upgrade-insecure-requests: 1" \
--header="Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7" \
--header="accept-encoding: identity" \
--header="accept-language: en-US;q=0.8,en;q=0.7" \
--header="cache-control: max-age=0" \
--header="priority: u=0, i" \
--rate-limit=1 \
--ignore-fragments \
--skip-tls-verification \
--max-connections-per-host=1 \
--timeout=20 \
--buffer-size=2147483647 \
--color=always \
--exclude="^(https:\/\/hyperledger-fabric.readthedocs.io\/([A-z_]+\/(v[\d]+.[\d]+.[\d]+|release)|(es|fa|fr|it|ja|ko|ml|pt|ru|vi|zh-cn|zh_CN)\/latest)).*$" \
--exclude="https://github.com/YOURGITHUBID/fabric-docs-i18n/pull/new/newtranslation" \
https://hyperledger-fabric.readthedocs.io/en/latest/