This repository has been archived by the owner on Jan 3, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* cherry pick #353 to release-2.0 Signed-off-by: ti-srebot <[email protected]> * Update ci.yaml Co-authored-by: Xuecheng Zhang <[email protected]> Co-authored-by: yikeke <[email protected]>
- Loading branch information
1 parent
e303b25
commit b27d7d2
Showing
3 changed files
with
40 additions
and
3 deletions.
There are no files selected for viewing
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
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
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 |
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