Skip to content
This repository has been archived by the owner on Jan 3, 2025. It is now read-only.

Commit

Permalink
*: check link via GitHub action (#353) (#356)
Browse files Browse the repository at this point in the history
* cherry pick #353 to release-1.0

Signed-off-by: ti-srebot <[email protected]>

* Update ci.yaml

* Delete maintain-dm-using-tiup.md

Co-authored-by: Xuecheng Zhang <[email protected]>
Co-authored-by: yikeke <[email protected]>
Co-authored-by: Keke Yi <[email protected]>
  • Loading branch information
4 people authored Sep 7, 2020
1 parent cedfd7b commit 89b3efc
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
with:
config: './.markdownlint.yaml'
args: '.'
- name: Verify links
- name: Verify internal links
run: ./hack/verify-links.sh
- name: Verify link anchors
- name: Verify internal link anchors
run: ./hack/verify-link-anchors.sh
37 changes: 37 additions & 0 deletions .github/workflows/link-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: external-link-check

on: [pull_request]

jobs:
base:
runs-on: ubuntu-18.04
steps:
- name: Check out code
uses: actions/checkout@v2

# NOTE:
# - the check process can be very fast,
# but if `-c` is too large then `Too Many Requests (HTTP error 429)` may be reported from `https://github.com/*`.
# - we hardcode `--document-root` to `/github/workspace` in the container now.
# - we use `http://172.*` as sample addresses in some docs, so we need to exclude them.
- name: Check external links in zh files
uses: peter-evans/link-checker@v1
with:
args: -c 32 -d /github/workspace -r -x "http://172.*|https://github.com/pingcap/dm/pull/.*|.*.md" zh*

- name: Check external links in en files
id: lc
uses: peter-evans/link-checker@v1
with:
args: -c 32 -d /github/workspace -r -x "http://172.*|https://github.com/pingcap/dm/pull/.*|.*.md" en*

- name: Fail if there were external link errors
if: ${{ steps.lc.outputs.exit_code }}
run: |
echo "Please check the broken links reported in previous steps \"Check external links in zh files\" and \"Check external links in en files\"."
exit ${{ steps.lc.outputs.exit_code }}
# Debug via SSH if previous steps failed
#- name: Set up tmate session
# if: ${{ failure() }}
# uses: mxschmitt/action-tmate@v2

0 comments on commit 89b3efc

Please sign in to comment.