Merge remote-tracking branch 'origin/2023.x' into heyoulin #14
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Copyright 2013-2023 the original author or authors. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# https://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, | |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
# See the License for the specific language governing permissions and | |
# limitations under the License. | |
# | |
name: 'Link Checker' | |
# **What it does**: Renders the content of every page and check all internal links. | |
# **Why we have it**: To make sure all links connect correctly. | |
# **Who does it impact**: Docs content. | |
on: | |
workflow_dispatch: | |
push: | |
# branches: [master, 'release/**'] | |
paths: | |
- '**/*.md' | |
- '**/link-check.yml' | |
pull_request: | |
branches: [2023.x, "release/**"] | |
paths: | |
- '**/*.md' | |
- '**/link-check.yml' | |
permissions: | |
contents: read | |
# Needed for the 'trilom/file-changes-action' action | |
pull-requests: read | |
# This allows a subsequently queued workflow run to interrupt previous runs | |
concurrency: | |
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' | |
cancel-in-progress: true | |
jobs: | |
check-links: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Get script | |
run: | | |
wget https://raw.githubusercontent.com/xuruidong/markdown-link-checker/main/link_checker.py | |
- name: Setup python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' | |
- name: Link check (critical, all files) | |
run: | | |
# python link_checker.py ./ --enable-external --ignore "http://apisix.iresty.com" "https://www.upyun.com" "https://github.com/apache/apisix/actions/workflows/build.yml/badge.svg" "https://httpbin.org/" "https://en.wikipedia.org/wiki/Cache" | |
python link_checker.py ./ |