langchain/.github/workflows/doc_lint.yml

35 lines
784 B
YAML
Raw Normal View History

---
2023-10-29 22:50:09 +00:00
name: Docs, templates, cookbook lint
on:
push:
2023-10-29 22:50:09 +00:00
branches: [ master ]
pull_request:
2023-10-29 22:50:09 +00:00
paths:
- 'docs/**'
- 'templates/**'
- 'cookbook/**'
2023-10-29 23:15:18 +00:00
- '.github/workflows/_lint.yml'
- '.github/workflows/doc_lint.yml'
2023-10-29 22:50:09 +00:00
workflow_dispatch:
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Run import check
run: |
# We should not encourage imports directly from main init file
# Expect for hub
2023-10-29 23:15:18 +00:00
git grep 'from langchain import' {docs/docs,templates,cookbook} | grep -vE 'from langchain import (hub)' && exit 1 || exit 0
2023-10-29 22:50:09 +00:00
2023-10-29 23:15:18 +00:00
lint:
2023-10-29 22:50:09 +00:00
uses:
./.github/workflows/_lint.yml
with:
2023-10-29 23:15:18 +00:00
working-directory: "."
secrets: inherit