-
Notifications
You must be signed in to change notification settings - Fork 27.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate validate links script from next-site and setup GitHub action (#…
…51365) This PR migrates and adapts the [validate docs links script from `next-site`](vercel/front#23185). This script is triggered by a GitHub action whenever a file in the `/docs` folder is updated. If broken links are found in the docs, the check fails and we post a comment on the PR with a list of broken links. Co-authored-by: Michael Novotny <[email protected]>
- Loading branch information
1 parent
fc172ee
commit 20047fc
Showing
12 changed files
with
2,850 additions
and
0 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,17 @@ | ||
# GitHub Action for Validating Documentation Links | ||
|
||
This action ensures that internal links in `.mdx` files in the `/docs/` directory are valid. It runs on every pull request that includes changes to these files. | ||
|
||
The action is triggered by the workflow defined in `.github/workflows/validate-docs-links.yml`. | ||
|
||
## Usage | ||
|
||
This action is written in TypeScript and compiled locally before being pushed to GitHub. | ||
|
||
To make changes: | ||
|
||
- Edit the `src/index.ts` file. | ||
- Navigate to the script folder `cd .github/actions/validate-docs-links` | ||
- Run `npm install` to install dependencies. | ||
- Run `npm run build` to compile code. This will create an updated `lib/index.js`. | ||
- Commit and push changes to GitHub. |
Large diffs are not rendered by default.
Oops, something went wrong.
2,350 changes: 2,350 additions & 0 deletions
2,350
.github/actions/validate-docs-links/lib/licenses.txt
Large diffs are not rendered by default.
Oops, something went wrong.
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,3 @@ | ||
{ | ||
"type": "module" | ||
} |
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,26 @@ | ||
{ | ||
"private": true, | ||
"type": "module", | ||
"exports": "./lib/index.js", | ||
"files": [ | ||
"src" | ||
], | ||
"scripts": { | ||
"build": "npm run types && ncc -m -o ./lib build src/index.ts --license licenses.txt", | ||
"types": "tsc" | ||
}, | ||
"devDependencies": { | ||
"@types/github-slugger": "^1.3.0", | ||
"@vercel/ncc": "0.34.0" | ||
}, | ||
"dependencies": { | ||
"@actions/github": "^5.1.1", | ||
"github-slugger": "1.2.0", | ||
"gray-matter": "4.0.2", | ||
"rehype-raw": "4.0.1", | ||
"remark-parse": "7.0.1", | ||
"remark-rehype": "5.0.0", | ||
"unified": "8.4.1", | ||
"unist-util-visit": "2.0.0" | ||
} | ||
} |
Oops, something went wrong.