mirror of
https://github.com/hwchase17/langchain.git
synced 2026-07-12 19:31:24 +00:00
Bumps the major group with 1 update in the / directory: [actions/checkout](https://github.com/actions/checkout). Updates `actions/checkout` from 6.0.2 to 7.0.0 <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/actions/checkout/releases">actions/checkout's releases</a>.</em></p> <blockquote> <h2>v7.0.0</h2> <h2>What's Changed</h2> <ul> <li>block checking out fork pr for pull_request_target and workflow_run by <a href="https://github.com/aiqiaoy"><code>@aiqiaoy</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2454">actions/checkout#2454</a></li> <li>Bump actions/publish-immutable-action from 0.0.3 to 0.0.4 in the minor-actions-dependencies group across 1 directory by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/actions/checkout/pull/2458">actions/checkout#2458</a></li> <li>Bump flatted from 3.3.1 to 3.4.2 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/actions/checkout/pull/2460">actions/checkout#2460</a></li> <li>Bump js-yaml from 4.1.0 to 4.2.0 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/actions/checkout/pull/2461">actions/checkout#2461</a></li> <li>Bump <code>@actions/core</code> and <code>@actions/tool-cache</code> and Remove uuid by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/actions/checkout/pull/2459">actions/checkout#2459</a></li> <li>upgrade module to esm and update dependencies by <a href="https://github.com/aiqiaoy"><code>@aiqiaoy</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2463">actions/checkout#2463</a></li> <li>Bump the minor-npm-dependencies group across 1 directory with 3 updates by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/actions/checkout/pull/2462">actions/checkout#2462</a></li> <li>getting ready for checkout v7 release by <a href="https://github.com/aiqiaoy"><code>@aiqiaoy</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2464">actions/checkout#2464</a></li> <li>update error wording by <a href="https://github.com/aiqiaoy"><code>@aiqiaoy</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2467">actions/checkout#2467</a></li> </ul> <h2>New Contributors</h2> <ul> <li><a href="https://github.com/aiqiaoy"><code>@aiqiaoy</code></a> made their first contribution in <a href="https://redirect.github.com/actions/checkout/pull/2454">actions/checkout#2454</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/actions/checkout/compare/v6.0.3...v7.0.0">https://github.com/actions/checkout/compare/v6.0.3...v7.0.0</a></p> <h2>v6.0.3</h2> <h2>What's Changed</h2> <ul> <li>Update changelog by <a href="https://github.com/ericsciple"><code>@ericsciple</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2357">actions/checkout#2357</a></li> <li>fix: expand merge commit SHA regex and add SHA-256 test cases by <a href="https://github.com/yaananth"><code>@yaananth</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2414">actions/checkout#2414</a></li> <li>Fix checkout init for SHA-256 repositories by <a href="https://github.com/yaananth"><code>@yaananth</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2439">actions/checkout#2439</a></li> <li>Update changelog for v6.0.3 by <a href="https://github.com/yaananth"><code>@yaananth</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2446">actions/checkout#2446</a></li> </ul> <h2>New Contributors</h2> <ul> <li><a href="https://github.com/yaananth"><code>@yaananth</code></a> made their first contribution in <a href="https://redirect.github.com/actions/checkout/pull/2414">actions/checkout#2414</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/actions/checkout/compare/v6...v6.0.3">https://github.com/actions/checkout/compare/v6...v6.0.3</a></p> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/actions/checkout/blob/main/CHANGELOG.md">actions/checkout's changelog</a>.</em></p> <blockquote> <h1>Changelog</h1> <h2>v7.0.0</h2> <ul> <li>Block checking out fork PR for pull_request_target and workflow_run by <a href="https://github.com/aiqiaoy"><code>@aiqiaoy</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2454">actions/checkout#2454</a></li> <li>Bump actions/publish-immutable-action from 0.0.3 to 0.0.4 in the minor-actions-dependencies group across 1 directory by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/actions/checkout/pull/2458">actions/checkout#2458</a></li> <li>Bump flatted from 3.3.1 to 3.4.2 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/actions/checkout/pull/2460">actions/checkout#2460</a></li> <li>Bump js-yaml from 4.1.0 to 4.2.0 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/actions/checkout/pull/2461">actions/checkout#2461</a></li> <li>Bump <code>@actions/core</code> and <code>@actions/tool-cache</code> and Remove uuid by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/actions/checkout/pull/2459">actions/checkout#2459</a></li> <li>upgrade module to esm and update dependencies by <a href="https://github.com/aiqiaoy"><code>@aiqiaoy</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2463">actions/checkout#2463</a></li> <li>Bump the minor-npm-dependencies group across 1 directory with 3 updates by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/actions/checkout/pull/2462">actions/checkout#2462</a></li> </ul> <h2>v6.0.3</h2> <ul> <li>Fix checkout init for SHA-256 repositories by <a href="https://github.com/yaananth"><code>@yaananth</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2439">actions/checkout#2439</a></li> <li>fix: expand merge commit SHA regex and add SHA-256 test cases by <a href="https://github.com/yaananth"><code>@yaananth</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2414">actions/checkout#2414</a></li> </ul> <h2>v6.0.2</h2> <ul> <li>Fix tag handling: preserve annotations and explicit fetch-tags by <a href="https://github.com/ericsciple"><code>@ericsciple</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2356">actions/checkout#2356</a></li> </ul> <h2>v6.0.1</h2> <ul> <li>Add worktree support for persist-credentials includeIf by <a href="https://github.com/ericsciple"><code>@ericsciple</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2327">actions/checkout#2327</a></li> </ul> <h2>v6.0.0</h2> <ul> <li>Persist creds to a separate file by <a href="https://github.com/ericsciple"><code>@ericsciple</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2286">actions/checkout#2286</a></li> <li>Update README to include Node.js 24 support details and requirements by <a href="https://github.com/salmanmkc"><code>@salmanmkc</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2248">actions/checkout#2248</a></li> </ul> <h2>v5.0.1</h2> <ul> <li>Port v6 cleanup to v5 by <a href="https://github.com/ericsciple"><code>@ericsciple</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2301">actions/checkout#2301</a></li> </ul> <h2>v5.0.0</h2> <ul> <li>Update actions checkout to use node 24 by <a href="https://github.com/salmanmkc"><code>@salmanmkc</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2226">actions/checkout#2226</a></li> </ul> <h2>v4.3.1</h2> <ul> <li>Port v6 cleanup to v4 by <a href="https://github.com/ericsciple"><code>@ericsciple</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2305">actions/checkout#2305</a></li> </ul> <h2>v4.3.0</h2> <ul> <li>docs: update README.md by <a href="https://github.com/motss"><code>@motss</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1971">actions/checkout#1971</a></li> <li>Add internal repos for checking out multiple repositories by <a href="https://github.com/mouismail"><code>@mouismail</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1977">actions/checkout#1977</a></li> <li>Documentation update - add recommended permissions to Readme by <a href="https://github.com/benwells"><code>@benwells</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2043">actions/checkout#2043</a></li> <li>Adjust positioning of user email note and permissions heading by <a href="https://github.com/joshmgross"><code>@joshmgross</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2044">actions/checkout#2044</a></li> <li>Update README.md by <a href="https://github.com/nebuk89"><code>@nebuk89</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2194">actions/checkout#2194</a></li> <li>Update CODEOWNERS for actions by <a href="https://github.com/TingluoHuang"><code>@TingluoHuang</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2224">actions/checkout#2224</a></li> <li>Update package dependencies by <a href="https://github.com/salmanmkc"><code>@salmanmkc</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2236">actions/checkout#2236</a></li> </ul> <h2>v4.2.2</h2> <ul> <li><code>url-helper.ts</code> now leverages well-known environment variables by <a href="https://github.com/jww3"><code>@jww3</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1941">actions/checkout#1941</a></li> <li>Expand unit test coverage for <code>isGhes</code> by <a href="https://github.com/jww3"><code>@jww3</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1946">actions/checkout#1946</a></li> </ul> <h2>v4.2.1</h2> <ul> <li>Check out other refs/* by commit if provided, fall back to ref by <a href="https://github.com/orhantoy"><code>@orhantoy</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1924">actions/checkout#1924</a></li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="9c091bb21b"><code>9c091bb</code></a> update error wording (<a href="https://redirect.github.com/actions/checkout/issues/2467">#2467</a>)</li> <li><a href="1044a6dea9"><code>1044a6d</code></a> getting ready for checkout v7 release (<a href="https://redirect.github.com/actions/checkout/issues/2464">#2464</a>)</li> <li><a href="f0282184c7"><code>f028218</code></a> Bump the minor-npm-dependencies group across 1 directory with 3 updates (<a href="https://redirect.github.com/actions/checkout/issues/2462">#2462</a>)</li> <li><a href="d914b262ff"><code>d914b26</code></a> upgrade module to esm and update dependencies (<a href="https://redirect.github.com/actions/checkout/issues/2463">#2463</a>)</li> <li><a href="537c7ef99c"><code>537c7ef</code></a> Bump <code>@actions/core</code> and <code>@actions/tool-cache</code> and Remove uuid (<a href="https://redirect.github.com/actions/checkout/issues/2459">#2459</a>)</li> <li><a href="130a169078"><code>130a169</code></a> Bump js-yaml from 4.1.0 to 4.2.0 (<a href="https://redirect.github.com/actions/checkout/issues/2461">#2461</a>)</li> <li><a href="7d09575332"><code>7d09575</code></a> Bump flatted from 3.3.1 to 3.4.2 (<a href="https://redirect.github.com/actions/checkout/issues/2460">#2460</a>)</li> <li><a href="0f9f3aa320"><code>0f9f3aa</code></a> Bump actions/publish-immutable-action (<a href="https://redirect.github.com/actions/checkout/issues/2458">#2458</a>)</li> <li><a href="f9e715a95f"><code>f9e715a</code></a> block checking out fork pr for pull_request_target and workflow_run (<a href="https://redirect.github.com/actions/checkout/issues/2454">#2454</a>)</li> <li><a href="df4cb1c069"><code>df4cb1c</code></a> Update changelog for v6.0.3 (<a href="https://redirect.github.com/actions/checkout/issues/2446">#2446</a>)</li> <li>Additional commits viewable in <a href="de0fac2e45...9c091bb21b">compare view</a></li> </ul> </details> <br /> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
229 lines
8.9 KiB
YAML
229 lines
8.9 KiB
YAML
# Reusable workflow: refreshes model profile data for any repo that uses the
|
|
# `langchain-profiles` CLI. Creates (or updates) a pull request with the
|
|
# resulting changes.
|
|
#
|
|
# Callers MUST set `permissions: { contents: write, pull-requests: write }` —
|
|
# reusable workflows cannot escalate the caller's token permissions.
|
|
#
|
|
# ── Example: external repo (langchain-google) ──────────────────────────
|
|
#
|
|
# jobs:
|
|
# refresh-profiles:
|
|
# uses: langchain-ai/langchain/.github/workflows/_refresh_model_profiles.yml@master
|
|
# with:
|
|
# providers: >-
|
|
# [
|
|
# {"provider":"google", "data_dir":"libs/genai/langchain_google_genai/data"},
|
|
# ]
|
|
# secrets:
|
|
# MODEL_PROFILE_BOT_CLIENT_ID: ${{ secrets.MODEL_PROFILE_BOT_CLIENT_ID }}
|
|
# MODEL_PROFILE_BOT_PRIVATE_KEY: ${{ secrets.MODEL_PROFILE_BOT_PRIVATE_KEY }}
|
|
|
|
name: "Refresh Model Profiles (reusable)"
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
providers:
|
|
description: >-
|
|
JSON array of objects, each with `provider` (models.dev provider ID)
|
|
and `data_dir` (path relative to repo root where `_profiles.py` and
|
|
`profile_augmentations.toml` live).
|
|
required: true
|
|
type: string
|
|
cli-path:
|
|
description: >-
|
|
Path (relative to workspace) to an existing `libs/model-profiles`
|
|
checkout. When set the workflow skips cloning the langchain repo and
|
|
uses this directory for the CLI instead. Useful when the caller IS
|
|
the langchain monorepo.
|
|
required: false
|
|
type: string
|
|
default: ""
|
|
cli-ref:
|
|
description: >-
|
|
Git ref of langchain-ai/langchain to checkout for the CLI.
|
|
Ignored when `cli-path` is set.
|
|
required: false
|
|
type: string
|
|
default: master
|
|
add-paths:
|
|
description: "Glob for files to stage in the PR commit."
|
|
required: false
|
|
type: string
|
|
default: "**/_profiles.py"
|
|
pr-branch:
|
|
description: "Branch name for the auto-created PR."
|
|
required: false
|
|
type: string
|
|
default: bot/refresh-model-profiles
|
|
pr-title:
|
|
description: "PR / commit title."
|
|
required: false
|
|
type: string
|
|
default: "chore(model-profiles): refresh model profile data"
|
|
pr-body:
|
|
description: "PR body."
|
|
required: false
|
|
type: string
|
|
default: |
|
|
Automated refresh of model profile data via `langchain-profiles refresh`.
|
|
|
|
🤖 Generated by the `refresh_model_profiles` workflow.
|
|
pr-labels:
|
|
description: "Comma-separated labels to apply to the PR."
|
|
required: false
|
|
type: string
|
|
default: bot
|
|
secrets:
|
|
MODEL_PROFILE_BOT_CLIENT_ID:
|
|
required: true
|
|
MODEL_PROFILE_BOT_PRIVATE_KEY:
|
|
required: true
|
|
|
|
permissions:
|
|
contents: write
|
|
pull-requests: write
|
|
|
|
jobs:
|
|
refresh-profiles:
|
|
name: refresh model profiles
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: "📋 Checkout"
|
|
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v6
|
|
|
|
- name: "📋 Checkout langchain-profiles CLI"
|
|
if: inputs.cli-path == ''
|
|
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v6
|
|
with:
|
|
repository: langchain-ai/langchain
|
|
ref: ${{ inputs.cli-ref }}
|
|
sparse-checkout: libs/model-profiles
|
|
path: _langchain-cli
|
|
|
|
- name: "🔧 Resolve CLI directory"
|
|
id: cli
|
|
env:
|
|
CLI_PATH: ${{ inputs.cli-path }}
|
|
run: |
|
|
if [ -n "${CLI_PATH}" ]; then
|
|
resolved="${GITHUB_WORKSPACE}/${CLI_PATH}"
|
|
if [ ! -d "${resolved}" ]; then
|
|
echo "::error::cli-path '${CLI_PATH}' does not exist at ${resolved}"
|
|
exit 1
|
|
fi
|
|
echo "dir=${CLI_PATH}" >> "$GITHUB_OUTPUT"
|
|
else
|
|
echo "dir=_langchain-cli/libs/model-profiles" >> "$GITHUB_OUTPUT"
|
|
fi
|
|
|
|
- name: "🐍 Set up Python + uv"
|
|
uses: astral-sh/setup-uv@0ca8f610542aa7f4acaf39e65cf4eb3c35091883 # v7
|
|
with:
|
|
version: "0.5.25"
|
|
python-version: "3.12"
|
|
enable-cache: true
|
|
cache-dependency-glob: "**/model-profiles/uv.lock"
|
|
|
|
- name: "📦 Install langchain-profiles CLI"
|
|
working-directory: ${{ steps.cli.outputs.dir }}
|
|
run: uv sync --frozen --no-group test --no-group dev --no-group lint
|
|
|
|
- name: "✅ Validate providers input"
|
|
env:
|
|
PROVIDERS_JSON: ${{ inputs.providers }}
|
|
run: |
|
|
echo "${PROVIDERS_JSON}" | jq -e 'type == "array" and length > 0' > /dev/null || {
|
|
echo "::error::providers input must be a non-empty JSON array"
|
|
exit 1
|
|
}
|
|
echo "${PROVIDERS_JSON}" | jq -e 'all(has("provider") and has("data_dir"))' > /dev/null || {
|
|
echo "::error::every entry in providers must have 'provider' and 'data_dir' keys"
|
|
exit 1
|
|
}
|
|
|
|
- name: "🔄 Refresh profiles"
|
|
env:
|
|
PROVIDERS_JSON: ${{ inputs.providers }}
|
|
run: |
|
|
cli_dir="${GITHUB_WORKSPACE}/${{ steps.cli.outputs.dir }}"
|
|
failed=""
|
|
mapfile -t rows < <(echo "${PROVIDERS_JSON}" | jq -c '.[]')
|
|
for row in "${rows[@]}"; do
|
|
provider=$(echo "${row}" | jq -r '.provider')
|
|
data_dir=$(echo "${row}" | jq -r '.data_dir')
|
|
echo "--- Refreshing ${provider} -> ${data_dir} ---"
|
|
if ! echo y | uv run --frozen --project "${cli_dir}" \
|
|
langchain-profiles refresh \
|
|
--provider "${provider}" \
|
|
--data-dir "${GITHUB_WORKSPACE}/${data_dir}"; then
|
|
echo "::error::Failed to refresh provider: ${provider}"
|
|
failed="${failed} ${provider}"
|
|
fi
|
|
done
|
|
if [ -n "${failed}" ]; then
|
|
echo "::error::The following providers failed:${failed}"
|
|
exit 1
|
|
fi
|
|
|
|
- name: "📝 Build PR body with change summary"
|
|
id: pr-body
|
|
env:
|
|
PROVIDERS_JSON: ${{ inputs.providers }}
|
|
PR_BODY: ${{ inputs.pr-body }}
|
|
run: |
|
|
# The refresh step modified the working tree without committing, so
|
|
# comparing against HEAD yields exactly the refresh's changes.
|
|
cli_dir="${GITHUB_WORKSPACE}/${{ steps.cli.outputs.dir }}"
|
|
body_file="${RUNNER_TEMP}/pr_body.md"
|
|
printf '%s\n\n' "${PR_BODY}" > "${body_file}"
|
|
# `summarize` builds the whole summary in memory and prints it once,
|
|
# so a failure exits non-zero before any stdout reaches the append —
|
|
# the body keeps only the static note, never a half-written summary.
|
|
if ! uv run --frozen --project "${cli_dir}" \
|
|
langchain-profiles summarize \
|
|
--providers "${PROVIDERS_JSON}" \
|
|
--base-ref HEAD \
|
|
--repo-root "${GITHUB_WORKSPACE}" >> "${body_file}"; then
|
|
echo "::warning::Could not generate change summary; see job log."
|
|
# Surface the degradation in the PR body too: the warning above only
|
|
# lands in the Actions log, which a PR reviewer won't see.
|
|
printf '\n> [!NOTE]\n> Automated change summary unavailable — see the workflow run log.\n' >> "${body_file}"
|
|
fi
|
|
echo "path=${body_file}" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: "🔑 Generate GitHub App token"
|
|
id: app-token
|
|
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3
|
|
with:
|
|
client-id: ${{ secrets.MODEL_PROFILE_BOT_CLIENT_ID }}
|
|
private-key: ${{ secrets.MODEL_PROFILE_BOT_PRIVATE_KEY }}
|
|
|
|
- name: "🔀 Create pull request"
|
|
id: create-pr
|
|
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8
|
|
with:
|
|
token: ${{ steps.app-token.outputs.token }}
|
|
branch: ${{ inputs.pr-branch }}
|
|
commit-message: ${{ inputs.pr-title }}
|
|
title: ${{ inputs.pr-title }}
|
|
body-path: ${{ steps.pr-body.outputs.path }}
|
|
labels: ${{ inputs.pr-labels }}
|
|
add-paths: ${{ inputs.add-paths }}
|
|
|
|
- name: "📝 Summary"
|
|
if: always()
|
|
env:
|
|
PR_OP: ${{ steps.create-pr.outputs.pull-request-operation }}
|
|
PR_URL: ${{ steps.create-pr.outputs.pull-request-url }}
|
|
JOB_STATUS: ${{ job.status }}
|
|
run: |
|
|
if [ "${PR_OP}" = "created" ] || [ "${PR_OP}" = "updated" ]; then
|
|
echo "### ✅ PR ${PR_OP}: ${PR_URL}" >> "$GITHUB_STEP_SUMMARY"
|
|
elif [ -z "${PR_OP}" ] && [ "${JOB_STATUS}" = "success" ]; then
|
|
echo "### ⏭️ Skipped: profiles already up to date" >> "$GITHUB_STEP_SUMMARY"
|
|
elif [ "${JOB_STATUS}" = "failure" ]; then
|
|
echo "### ❌ Job failed — check step logs for details" >> "$GITHUB_STEP_SUMMARY"
|
|
fi
|