forked from pingcap/docs-cn
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cherry pick pingcap#4464 to release-2.1
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
- Loading branch information
Showing
6 changed files
with
52 additions
and
23 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,31 @@ | ||
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 | ||
id: lc | ||
uses: peter-evans/link-checker@v1 | ||
with: | ||
args: -c 32 -d /github/workspace -r -x "http://172.*|https://github.com/.*/pull/.*|https://github.com/.*/issues/.*|https://github.com/[^.\n]*$|http://127.0.0.1.*|http://localhost.*|http://.*:.*|https://static.googleusercontent.com/media/research.google.com/.*|.*.md" . | ||
|
||
- name: Fail if there were external link errors | ||
if: ${{ steps.lc.outputs.exit_code }} | ||
run: | | ||
echo "Please check the broken links reported in the previous step \"Check external links\"." | ||
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
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
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