Skip to content

Commit c99195b

Browse files
authored
Branch was updated using the 'autoupdate branch' Actions workflow.
2 parents 6786b20 + 0babb6a commit c99195b

9 files changed

Lines changed: 471 additions & 1007 deletions

.github/workflows/check-all-english-links.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: Check all English links
22

33
on:
4+
workflow_dispatch:
45
schedule:
56
- cron: "40 19 * * *" # once a day at 19:40 UTC / 11:40 PST
67

@@ -10,21 +11,16 @@ jobs:
1011
if: github.repository == 'github/docs-internal'
1112
runs-on: ubuntu-latest
1213
steps:
13-
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
14-
- name: npm ci
15-
run: npm ci
16-
- name: npm run build
17-
run: npm run build
1814
- name: Run script
19-
run: script/check-external-links en > broken_links.md
15+
run: script/check-english-links.js > broken_links.md
2016
- name: Check if any broken links
2117
id: check
2218
run: |
23-
if [ "$(grep 'All links are good' broken_links.md)" ]; then
19+
if [ "$(grep '0 broken links found' broken_links.md)" ]; then
2420
echo ::set-output name=continue::no
2521
else
2622
echo "::set-output name=continue::yes"
27-
echo "::set-output name=title::$(grep 'found on help.github.com' broken_links.md)"
23+
echo "::set-output name=title::$(head -1 broken_links.md)"
2824
fi
2925
- if: ${{ steps.check.outputs.continue == 'yes' }}
3026
name: Create issue from file

.gitignore

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
node_modules
55
npm-debug.log
66
coverage
7-
8-
# blc: broken link checker
9-
blc_output.log
10-
blc_output_internal.log
11-
dist
7+
.linkinator
8+
broken_links.md
9+
dist

lib/excluded-links.js

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,20 @@
1+
// Linkinator treats the following as regex.
12
module.exports = [
2-
// GitHub search links fail with "429 Too Many Requests"
3-
'https://github.com/search?*',
3+
// Skip GitHub search links.
4+
'https://github.com/search?.*',
45
'https://github.com/github/gitignore/search?',
56

6-
// LinkedIn links fail due to bug: https://github.com/stevenvachon/broken-link-checker/issues/91
7-
'https://www.linkedin.com/*',
8-
9-
// blc returns "BLC_UNKNOWN" on this link, even though cURL returns "302 Found"
10-
'https://www.ilo.org/dyn/normlex/en/f?p=NORMLEXPUB:12100:0::NO::P12100_ILO_CODE:P029',
11-
12-
// the codercat link works but blc reports a false 404
13-
'https://github.com/Codertocat/hello-world-npm/packages/10696?version=1.0.1',
14-
15-
// this URL started returning 403 to blc and cURL even though it works in a browser; see docs-internal #10124
16-
'https://haveibeenpwned.com/',
17-
'https://haveibeenpwned.com/*',
18-
19-
// this is a private repo customers are given access to when they purchase Insights; see docs-internal #12037
7+
// These links require auth.
8+
'https://github.com/settings/profile',
9+
'https://github.com/github/docs/edit',
2010
'https://github.com/github/insights-releases/releases/latest',
2111

22-
// developer content uses these for examples; they should not be checked
23-
'http://localhost:1234/*',
12+
// Developer content uses these for examples; they should not be checked.
13+
'http://localhost:1234',
2414
'localhost:3000',
2515

26-
// this URL works but blc reports a false 404
16+
// Oneoff links that link checkers think are broken but are not.
17+
'https://haveibeenpwned.com/',
18+
'https://www.ilo.org/dyn/normlex/en/f?p=NORMLEXPUB:12100:0::NO::P12100_ILO_CODE:P029',
2719
'http://www.w3.org/wiki/LinkHeader/'
2820
]

0 commit comments

Comments
 (0)