skills / cli changes #1157
Workflow file for this run
This file contains hidden or 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
| --- | |
| name: Check for External Doc Links | |
| on: | |
| pull_request: | |
| branches: [main] | |
| paths: | |
| - "**/*.md" | |
| - "**/*.mdx" | |
| jobs: | |
| check-external-doc-links: | |
| name: Block links to old doc sites | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Check for links to js.langchain.com and python.langchain.com | |
| run: | | |
| # Get the diff of added lines only (lines starting with +, excluding the +++ header) | |
| ADDED_LINES=$(git diff origin/${{ github.base_ref }}...HEAD --diff-filter=ACMR -- '*.md' '*.mdx' | grep -E '^\+' | grep -v '^\+\+\+' || true) | |
| # Check if any added lines contain links to the old doc sites | |
| if echo "$ADDED_LINES" | grep -qE '(js\.langchain\.com|python\.langchain\.com)'; then | |
| echo "β This PR adds links to deprecated documentation sites." | |
| echo "" | |
| echo "Links to js.langchain.com and python.langchain.com are not allowed." | |
| echo "Please use relative links to reference documentation within this repository." | |
| echo "" | |
| echo "Matches found:" | |
| echo "$ADDED_LINES" | grep -E '(js\.langchain\.com|python\.langchain\.com)' | head -20 | |
| exit 1 | |
| else | |
| echo "β No links to deprecated doc sites found in added content." | |
| fi |