Skip to content

Commit

Permalink
docs[minor]ci[minor]: Add script & CI to check recurring links daily (l…
Browse files Browse the repository at this point in the history
  • Loading branch information
bracesproul authored and rahul-trip committed Mar 27, 2024
1 parent ac95170 commit 314a751
Show file tree
Hide file tree
Showing 4 changed files with 331 additions and 5 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/check-broken-links.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Check Broken Links

on:
workflow_dispatch:
schedule:
- cron: '0 13 * * *'

jobs:
check-links:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: "yarn"
- name: Install dependencies
run: cd ./docs && yarn install --immutable --mode=skip-build
- name: Check broken links
run: cd ./docs && yarn check-broken-links
4 changes: 3 additions & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"format": "prettier --write \"**/*.{js,jsx,ts,tsx,md,mdx}\"",
"format:check": "prettier --check \"**/*.{js,jsx,ts,tsx,md,mdx}\"",
"gen": "yarn gen:supabase",
"gen:supabase": "npx supabase gen types typescript --project-id 'xsqpnijvmbodcxyapnyq' --schema public > ./src/supabase.d.ts"
"gen:supabase": "npx supabase gen types typescript --project-id 'xsqpnijvmbodcxyapnyq' --schema public > ./src/supabase.d.ts",
"check-broken-links": "bash vercel_build.sh && node ./scripts/check-broken-links.js"
},
"dependencies": {
"@docusaurus/core": "2.4.3",
Expand All @@ -38,6 +39,7 @@
},
"devDependencies": {
"@babel/eslint-parser": "^7.18.2",
"@langchain/scripts": "^0.0.9",
"docusaurus-plugin-typedoc": "next",
"dotenv": "^16.4.5",
"eslint": "^8.19.0",
Expand Down
7 changes: 7 additions & 0 deletions docs/scripts/check-broken-links.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Sorry py folks, gotta be js for this one
const { checkBrokenLinks } = require("@langchain/scripts/check_broken_links");

checkBrokenLinks("docs", {
timeout: 10000,
whitelist: ["microsoft.com"],
});

0 comments on commit 314a751

Please sign in to comment.