Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs[minor]ci[minor]: Add script & CI to check recurring links daily #19100

Merged
merged 2 commits into from
Mar 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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"],
});