2023-09-17 00:22:48 +00:00
|
|
|
---
|
2023-10-29 22:50:09 +00:00
|
|
|
name: Docs, templates, cookbook lint
|
2023-09-17 00:22:48 +00:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2023-10-29 22:50:09 +00:00
|
|
|
branches: [ master ]
|
2023-09-17 00:22:48 +00:00
|
|
|
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:
|
2023-09-17 00:22:48 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
check:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
2023-10-31 16:41:18 +00:00
|
|
|
uses: actions/checkout@v4
|
2023-09-17 00:22:48 +00:00
|
|
|
|
|
|
|
- name: Run import check
|
|
|
|
run: |
|
|
|
|
# We should not encourage imports directly from main init file
|
2023-09-17 05:08:11 +00:00
|
|
|
# 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
|