diff --git a/.github/workflows/_release.yml b/.github/workflows/_release.yml index a7634740c9c..ecdb14bb932 100644 --- a/.github/workflows/_release.yml +++ b/.github/workflows/_release.yml @@ -141,7 +141,7 @@ jobs: # Runs in isolated environment with minimal permissions for security build: name: ๐Ÿ“ฆ Build distribution - if: github.ref == 'refs/heads/master' || inputs.dangerous-nonmaster-release + if: github.repository_owner == 'langchain-ai' && (github.ref == 'refs/heads/master' || inputs.dangerous-nonmaster-release) environment: Release runs-on: ubuntu-latest permissions: diff --git a/.github/workflows/auto-label-by-package.yml b/.github/workflows/auto-label-by-package.yml index a62d2828edd..3e9eafc8c14 100644 --- a/.github/workflows/auto-label-by-package.yml +++ b/.github/workflows/auto-label-by-package.yml @@ -9,6 +9,7 @@ permissions: jobs: label-by-package: + if: github.repository_owner == 'langchain-ai' permissions: issues: write runs-on: ubuntu-latest diff --git a/.github/workflows/check_agents_sync.yml b/.github/workflows/check_agents_sync.yml index 88c5d13d030..851a33ae433 100644 --- a/.github/workflows/check_agents_sync.yml +++ b/.github/workflows/check_agents_sync.yml @@ -23,6 +23,7 @@ permissions: jobs: check-sync: name: "verify files are identical" + if: github.repository_owner == 'langchain-ai' runs-on: ubuntu-latest steps: - name: "๐Ÿ“‹ Checkout Code" diff --git a/.github/workflows/check_diffs.yml b/.github/workflows/check_diffs.yml index d46c3469077..949c20a47af 100644 --- a/.github/workflows/check_diffs.yml +++ b/.github/workflows/check_diffs.yml @@ -192,6 +192,7 @@ jobs: # Verify _release.yml dropdown options stay in sync with package directories check-release-options: name: "Validate Release Options" + if: github.repository_owner == 'langchain-ai' runs-on: ubuntu-latest steps: - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v6 diff --git a/.github/workflows/check_release_deps.yml b/.github/workflows/check_release_deps.yml index 76b70e99676..aef6b9b7615 100644 --- a/.github/workflows/check_release_deps.yml +++ b/.github/workflows/check_release_deps.yml @@ -44,6 +44,7 @@ jobs: # intra-monorepo pins ahead of a sibling release on purpose. Maintainers can # acknowledge an unusual coordinated release with the bypass label. if: >- + github.repository_owner == 'langchain-ai' && startsWith(github.event.pull_request.title, 'release') && !contains(github.event.pull_request.labels.*.name, 'release-deps: acknowledged') runs-on: ubuntu-latest diff --git a/.github/workflows/check_versions.yml b/.github/workflows/check_versions.yml index 24b2587718a..1b69843ffbb 100644 --- a/.github/workflows/check_versions.yml +++ b/.github/workflows/check_versions.yml @@ -19,6 +19,7 @@ permissions: jobs: check_version_equality: + if: github.repository_owner == 'langchain-ai' runs-on: ubuntu-latest steps: diff --git a/.github/workflows/close_unchecked_issues.yml b/.github/workflows/close_unchecked_issues.yml index 4c2d97f4884..b980eefb08a 100644 --- a/.github/workflows/close_unchecked_issues.yml +++ b/.github/workflows/close_unchecked_issues.yml @@ -29,6 +29,7 @@ concurrency: jobs: check-boxes: + if: github.repository_owner == 'langchain-ai' runs-on: ubuntu-latest permissions: contents: read diff --git a/.github/workflows/codspeed.yml b/.github/workflows/codspeed.yml index 9f96733004e..7140373a43b 100644 --- a/.github/workflows/codspeed.yml +++ b/.github/workflows/codspeed.yml @@ -29,7 +29,7 @@ jobs: build: name: "Detect Changes" runs-on: ubuntu-latest - if: ${{ !contains(github.event.pull_request.labels.*.name, 'codspeed-ignore') }} + if: ${{ github.repository_owner == 'langchain-ai' && !contains(github.event.pull_request.labels.*.name, 'codspeed-ignore') }} steps: - name: "๐Ÿ“‹ Checkout Code" uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v6 diff --git a/.github/workflows/pr_labeler.yml b/.github/workflows/pr_labeler.yml index 0d904d03f3a..ff0c851cef9 100644 --- a/.github/workflows/pr_labeler.yml +++ b/.github/workflows/pr_labeler.yml @@ -42,6 +42,7 @@ concurrency: jobs: label: + if: github.repository_owner == 'langchain-ai' runs-on: ubuntu-latest permissions: contents: read diff --git a/.github/workflows/pr_labeler_backfill.yml b/.github/workflows/pr_labeler_backfill.yml index d064610c676..83450caf9d0 100644 --- a/.github/workflows/pr_labeler_backfill.yml +++ b/.github/workflows/pr_labeler_backfill.yml @@ -19,6 +19,7 @@ permissions: jobs: backfill: + if: github.repository_owner == 'langchain-ai' runs-on: ubuntu-latest permissions: contents: read diff --git a/.github/workflows/remove_waiting_on_author.yml b/.github/workflows/remove_waiting_on_author.yml index 0251efc88b3..2f19ad224bc 100644 --- a/.github/workflows/remove_waiting_on_author.yml +++ b/.github/workflows/remove_waiting_on_author.yml @@ -20,6 +20,7 @@ permissions: jobs: remove-label: if: >- + github.repository_owner == 'langchain-ai' && github.event.issue.state == 'open' && contains(github.event.issue.labels.*.name, 'waiting-on-author') && github.event.comment.user.type != 'Bot' && diff --git a/.github/workflows/reopen_on_assignment.yml b/.github/workflows/reopen_on_assignment.yml index a27bae145be..6799f6d3650 100644 --- a/.github/workflows/reopen_on_assignment.yml +++ b/.github/workflows/reopen_on_assignment.yml @@ -19,6 +19,7 @@ permissions: jobs: reopen-linked-prs: + if: github.repository_owner == 'langchain-ai' runs-on: ubuntu-latest permissions: actions: write diff --git a/.github/workflows/require_issue_link.yml b/.github/workflows/require_issue_link.yml index bf45a3df969..6ccecf2846a 100644 --- a/.github/workflows/require_issue_link.yml +++ b/.github/workflows/require_issue_link.yml @@ -35,6 +35,7 @@ jobs: # Skip entirely when the PR already carries "trusted-contributor" or # "bypass-issue-check". if: >- + github.repository_owner == 'langchain-ai' && !contains(github.event.pull_request.labels.*.name, 'trusted-contributor') && !contains(github.event.pull_request.labels.*.name, 'bypass-issue-check') && ( diff --git a/.github/workflows/tag-external-issues.yml b/.github/workflows/tag-external-issues.yml index 0425d7a9ebb..ef584b7f6d0 100644 --- a/.github/workflows/tag-external-issues.yml +++ b/.github/workflows/tag-external-issues.yml @@ -44,7 +44,7 @@ concurrency: jobs: tag-external: - if: github.event_name != 'workflow_dispatch' + if: github.repository_owner == 'langchain-ai' && github.event_name != 'workflow_dispatch' runs-on: ubuntu-latest permissions: contents: read @@ -112,7 +112,7 @@ jobs: console.log(`Added '${label}' label to issue #${issue_number}`); backfill: - if: github.event_name == 'workflow_dispatch' + if: github.repository_owner == 'langchain-ai' && github.event_name == 'workflow_dispatch' runs-on: ubuntu-latest permissions: contents: read diff --git a/.github/workflows/v03_api_doc_build.yml b/.github/workflows/v03_api_doc_build.yml deleted file mode 100644 index b514a50c64e..00000000000 --- a/.github/workflows/v03_api_doc_build.yml +++ /dev/null @@ -1,167 +0,0 @@ -# Build the API reference documentation for v0.3 branch. -# -# Manual trigger only. -# -# Built HTML pushed to langchain-ai/langchain-api-docs-html. -# -# Looks for langchain-ai org repos in packages.yml and checks them out. -# Calls prep_api_docs_build.py. - -name: "๐Ÿ“š API Docs (v0.3)" -run-name: "Build & Deploy API Reference (v0.3)" - -on: - workflow_dispatch: - -permissions: - contents: read - -env: - PYTHON_VERSION: "3.11" - -jobs: - build: - if: github.repository == 'langchain-ai/langchain' || github.event_name != 'schedule' - runs-on: ubuntu-latest - permissions: - contents: read - steps: - - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v6 - with: - ref: v0.3 - path: langchain - - - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v6 - with: - repository: langchain-ai/langchain-api-docs-html - path: langchain-api-docs-html - token: ${{ secrets.TOKEN_GITHUB_API_DOCS_HTML }} - - - name: "๐Ÿ“‹ Extract Repository List with yq" - id: get-unsorted-repos - uses: mikefarah/yq@e2f1d5ccf73239195bf92280cd47596751492449 # master - with: - cmd: | - # Extract repos from packages.yml that are in the langchain-ai org - # (excluding 'langchain' itself) - yq ' - .packages[] - | select( - ( - (.repo | test("^langchain-ai/")) - and - (.repo != "langchain-ai/langchain") - ) - or - (.include_in_api_ref // false) - ) - | .repo - ' langchain/libs/packages.yml - - - name: "๐Ÿ“‹ Parse YAML & Checkout Repositories" - env: - REPOS_UNSORTED: ${{ steps.get-unsorted-repos.outputs.result }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - # Get unique repositories - REPOS=$(echo "$REPOS_UNSORTED" | sort -u) - # Checkout each unique repository - for repo in $REPOS; do - # Validate repository format (allow any org with proper format) - if [[ ! "$repo" =~ ^[a-zA-Z0-9_.-]+/[a-zA-Z0-9_.-]+$ ]]; then - echo "Error: Invalid repository format: $repo" - exit 1 - fi - - REPO_NAME=$(echo $repo | cut -d'/' -f2) - - # Additional validation for repo name - if [[ ! "$REPO_NAME" =~ ^[a-zA-Z0-9_.-]+$ ]]; then - echo "Error: Invalid repository name: $REPO_NAME" - exit 1 - fi - echo "Checking out $repo to $REPO_NAME" - - # Special handling for langchain-tavily: checkout by commit hash - if [[ "$REPO_NAME" == "langchain-tavily" ]]; then - git clone https://github.com/$repo.git $REPO_NAME - cd $REPO_NAME - git checkout f3515654724a9e87bdfe2c2f509d6cdde646e563 - cd .. - else - git clone --depth 1 --branch v0.3 https://github.com/$repo.git $REPO_NAME - fi - done - - - name: "๐Ÿ Setup Python ${{ env.PYTHON_VERSION }}" - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6 - id: setup-python - with: - python-version: ${{ env.PYTHON_VERSION }} - - - name: "๐Ÿ“ฆ Install Initial Python Dependencies using uv" - working-directory: langchain - run: | - python -m pip install -U uv - python -m uv pip install --upgrade --no-cache-dir pip setuptools pyyaml - - - name: "๐Ÿ“ฆ Organize Library Directories" - # Places cloned partner packages into libs/partners structure - run: python langchain/.github/scripts/prep_api_docs_build.py - - - name: "๐Ÿงน Clear Prior Build" - run: - # Remove artifacts from prior docs build - rm -rf langchain-api-docs-html/api_reference_build/html - - - name: "๐Ÿ“ฆ Install Documentation Dependencies using uv" - working-directory: langchain - run: | - # Install all partner packages in editable mode with overrides - python -m uv pip install $(ls ./libs/partners | grep -v azure-ai | xargs -I {} echo "./libs/partners/{}") --overrides ./docs/vercel_overrides.txt --prerelease=allow - - # Install langchain-azure-ai with tools extra - python -m uv pip install "./libs/partners/azure-ai[tools]" --overrides ./docs/vercel_overrides.txt --prerelease=allow - - # Install core langchain and other main packages - python -m uv pip install libs/core libs/langchain libs/text-splitters libs/community libs/experimental libs/standard-tests - - # Install Sphinx and related packages for building docs - python -m uv pip install -r docs/api_reference/requirements.txt - - - name: "๐Ÿ”ง Configure Git Settings" - working-directory: langchain - run: | - git config --local user.email "actions@github.com" - git config --local user.name "Github Actions" - - - name: "๐Ÿ“š Build API Documentation" - working-directory: langchain - run: | - # Generate the API reference RST files - python docs/api_reference/create_api_rst.py - - # Build the HTML documentation using Sphinx - # -T: show full traceback on exception - # -E: don't use cached environment (force rebuild, ignore cached doctrees) - # -b html: build HTML docs (vs PDS, etc.) - # -d: path for the cached environment (parsed document trees / doctrees) - # - Separate from output dir for faster incremental builds - # -c: path to conf.py - # -j auto: parallel build using all available CPU cores - python -m sphinx -T -E -b html -d ../langchain-api-docs-html/_build/doctrees -c docs/api_reference docs/api_reference ../langchain-api-docs-html/api_reference_build/html -j auto - - # Post-process the generated HTML - python docs/api_reference/scripts/custom_formatter.py ../langchain-api-docs-html/api_reference_build/html - - # Default index page is blank so we copy in the actual home page. - cp ../langchain-api-docs-html/api_reference_build/html/{reference,index}.html - - # Removes Sphinx's intermediate build artifacts after the build is complete. - rm -rf ../langchain-api-docs-html/_build/ - - # Commit and push changes to langchain-api-docs-html repo - - uses: EndBug/add-and-commit@290ea2c423ad77ca9c62ae0f5b224379612c0321 # v10.0.0 - with: - cwd: langchain-api-docs-html - message: "Update API docs build from v0.3 branch"