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.
.github: check connectivity of external links via GitHub action (ping…
…cap#4464) * add check * add id * exclude https://github.com/pingcap/tidb/pull/.* links * fix indent * exclude all github pull requests * test: exclude some github links * exclude local hosts * exlude urls with hostname+port pattern * exclude googleusercontent site pages * update pdf link * exclude static.googleusercontent.com/media/research.google.com/ urls * update regex * fix one link and fix regex * Update figma-quick-start-guide.md * test connectivity * Update figma-quick-start-guide.md * change concurrency to 24 * Revert "change concurrency to 24" This reverts commit 003f981. * delete two figma links * Update figma-quick-start-guide.md
- Loading branch information
Showing
6 changed files
with
49 additions
and
24 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