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
*: check connectivity of external links via GitHub action #353
Merged
Merged
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
6074146
*: check link via GitHub action
csuzhangxc 520806b
*: exclude to `media`
csuzhangxc 8e2dc46
*: debug liche
csuzhangxc 7ceef22
*: debug liche
csuzhangxc bde59d5
*: debug liche
csuzhangxc 9f31ed3
*: debug liche
csuzhangxc 82a5d2f
*: update args for liche
csuzhangxc c4801f0
Fail if there were link errors
csuzhangxc 4a6c2a1
*: fix env
csuzhangxc 9c7d070
*: try hardcode doc root
csuzhangxc 4f4b712
*: update doc root
csuzhangxc e31d5f0
*: decrease concurrency to avoid "HTTP error 429"
csuzhangxc 7e606e9
*: decrease concurrency again
csuzhangxc 5a6ba35
*: decrease concurrency to 4; add some notes
csuzhangxc 090fc15
*: exclude "https://github.com/pingcap/dm/pull/.*"
csuzhangxc 6e5e6a1
*: do not show OK
csuzhangxc 6802163
*: try update reg
csuzhangxc 2390174
*: debug reg
csuzhangxc e285726
*: debug reg
csuzhangxc 43bfd08
*: add echo
csuzhangxc 01c1c68
*: exlude .md files
csuzhangxc 2c902b0
Update .github/workflows/link-check.yaml
csuzhangxc 780ec38
Update .github/workflows/link-check.yaml
csuzhangxc 6b2ead5
Update .github/workflows/link-check.yaml
csuzhangxc c308e0e
Update .github/workflows/link-check.yaml
csuzhangxc 0e290e0
Update .github/workflows/link-check.yaml
csuzhangxc 0918796
Merge branch 'master' into link-check
csuzhangxc 7628193
fix an external link; update ci.yaml
81661a9
test ci
97af4bc
Revert "test ci"
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
请教下,上面的「Check external links in zh files」那一步没有 id,如果只有 zh 有 error、en 没有 error,下面的 ${{ steps.lc.outputs.exit_code }} 会是 1 吗? @csuzhangxc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
啊。我的错误,都需要加 id、都需要判断
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
嗯嗯,学程哥帮忙提个 pr 改下?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#370 PTAL