Skip to content

Commit 0035e14

Browse files
author
Peter Bengtsson
authored
one fast link checker to rule them all (#23041)
* one fast link checker to rule them all * -L alias * refactor * hacking away * passing pages * adding a workflow * limit level to critical * ability to pass a specific set of files * testing specific files * remove temporary debugging * reorganize the printing * formatting of output * check images too * prettyFullPath() * minimal permission on workflow * update comment * new permission * fix actions shas
1 parent 31b1bd2 commit 0035e14

3 files changed

Lines changed: 510 additions & 1 deletion

File tree

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: 'Link Checker: All English'
2+
3+
# **What it does**: Renders the content of every page and check all internal links.
4+
# **Why we have it**: To make sure all links connect correctly.
5+
# **Who does it impact**: Docs content.
6+
7+
on:
8+
workflow_dispatch:
9+
push:
10+
branches:
11+
- main
12+
pull_request:
13+
14+
permissions:
15+
contents: read
16+
# Needed for the 'trilom/file-changes-action' action
17+
pull-requests: read
18+
19+
jobs:
20+
build:
21+
runs-on: ${{ fromJSON('["ubuntu-latest", "self-hosted"]')[github.repository == 'github/docs-internal'] }}
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
25+
26+
- name: Setup node
27+
uses: actions/setup-node@04c56d2f954f1e4c69436aa54cfef261a018f458
28+
with:
29+
node-version: 16.13.x
30+
cache: npm
31+
32+
- name: Install
33+
run: npm ci
34+
35+
- name: Gather files changed
36+
uses: trilom/file-changes-action@a6ca26c14274c33b15e6499323aac178af06ad4b
37+
id: get_diff_files
38+
with:
39+
# So that `steps.get_diff_files.outputs.files` becomes
40+
# a string like `foo.js path/bar.md`
41+
output: ' '
42+
- name: Insight into changed files
43+
run: |
44+
echo ${{ steps.get_diff_files.outputs.files }}
45+
46+
- name: Link check (warnings, changed files)
47+
run: |
48+
./script/rendered-content-link-checker.mjs \
49+
--language en \
50+
--max 100 \
51+
--check-anchors \
52+
--check-images \
53+
--verbose \
54+
${{ steps.get_diff_files.outputs.files }}
55+
56+
- name: Link check (critical, all files)
57+
run: |
58+
59+
./script/rendered-content-link-checker.mjs \
60+
--language en \
61+
--exit \
62+
--verbose \
63+
--check-images \
64+
--level critical

content/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/committing-changes-to-a-pull-request-branch-created-from-a-fork.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ Only the user who created the pull request can give you permission to push commi
7272

7373
{% tip %}
7474

75-
**Tip:** For more information about pull request branches, including examples, see "[Creating a Pull Request](/articles/creating-a-pull-request/#changing-the-branch-range-and-destination-repository)."
75+
**Tip:** For more information about pull request branches, including examples, see "[Creating a Pull Request](/articles/creating-a-pull-request#changing-the-branch-range-and-destination-repository)."
7676

7777
{% endtip %}
7878
8. At this point, you can do anything you want with this branch. You can push new commits to it, run some local tests, or merge other branches into the branch. Make modifications as you like.

0 commit comments

Comments
 (0)