diff --git a/.github/workflows/link_check.yml b/.github/workflows/link_check.yml new file mode 100644 index 000000000..736345c7c --- /dev/null +++ b/.github/workflows/link_check.yml @@ -0,0 +1,39 @@ +name: Check Links + +on: + pull_request: + branches: + - main + push: + branches: + - main + schedule: + - cron: '0 5 * * *' + workflow_dispatch: + +jobs: + markdown-link-check: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Check links in Markdown files + uses: gaurav-nelson/github-action-markdown-link-check@v1 + + notebook-link-check: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -U pytest pytest-check-links langsmith langchain GitPython + - name: Check links in notebooks + env: + LANGCHAIN_API_KEY: test + run: pytest -o python_files=non_python_only --check-links --ignore="*.py" -k .ipynb --check-links-ignore "https://(api|web)\.smith\.langchain\.com/.*" .