Skip to content

Commit

Permalink
cherry pick #4792 to release-2.1 (#4793)
Browse files Browse the repository at this point in the history
Signed-off-by: ti-srebot <[email protected]>

Co-authored-by: Keke Yi <[email protected]>
  • Loading branch information
ti-srebot and yikeke authored Nov 3, 2020
1 parent 237f073 commit 9a218cb
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/link-check.yaml
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/.*|http://www.brendangregg.com/perf.html.*|.*.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

0 comments on commit 9a218cb

Please sign in to comment.