Skip to content

Commit 0081dea

Browse files
authored
feat(infra): schedule daily model profile refresh with job summary (langchain-ai#35354)
- Schedules the `refresh_model_profiles` workflow to run daily at 08:00 UTC (manual trigger available). - Adds a job summary step that reports whether a PR was created/updated or skipped because profiles were already up to date. - Each run supersedes any stale PR from a previous run since the action force-pushes to a fixed branch (`bot/refresh-model-profiles`).
1 parent 7019269 commit 0081dea

1 file changed

Lines changed: 18 additions & 2 deletions

File tree

β€Ž.github/workflows/refresh_model_profiles.ymlβ€Ž

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
# Refreshes model profile data for all in-monorepo partner integrations by
22
# pulling the latest metadata from models.dev via the `langchain-profiles` CLI.
33
#
4-
# Creates a pull request with any changes. Triggered manually from the Actions UI.
4+
# Creates a pull request with any changes. Runs daily and can be triggered
5+
# manually from the Actions UI. Uses a fixed branch so each run supersedes
6+
# any stale PR from a previous run.
57

68
name: "πŸ”„ Refresh Model Profiles"
79

810
on:
11+
schedule:
12+
- cron: "0 8 * * *" # daily at 08:00 UTC
913
workflow_dispatch:
1014

1115
permissions:
@@ -63,7 +67,8 @@ jobs:
6367
private-key: ${{ secrets.MODEL_PROFILE_BOT_PRIVATE_KEY }}
6468

6569
- name: "πŸ”€ Create pull request"
66-
uses: peter-evans/create-pull-request@v7
70+
id: create-pr
71+
uses: peter-evans/create-pull-request@v8
6772
with:
6873
token: ${{ steps.app-token.outputs.token }}
6974
branch: bot/refresh-model-profiles
@@ -74,4 +79,15 @@ jobs:
7479
integrations via `langchain-profiles refresh`.
7580
7681
πŸ€– Generated by the `refresh_model_profiles` workflow.
82+
labels: bot
7783
add-paths: libs/partners/**/data/_profiles.py
84+
85+
- name: "πŸ“ Summary"
86+
run: |
87+
op="${{ steps.create-pr.outputs.pull-request-operation }}"
88+
url="${{ steps.create-pr.outputs.pull-request-url }}"
89+
if [ "$op" = "created" ] || [ "$op" = "updated" ]; then
90+
echo "### βœ… PR ${op}: ${url}" >> "$GITHUB_STEP_SUMMARY"
91+
else
92+
echo "### ⏭️ Skipped: profiles already up to date" >> "$GITHUB_STEP_SUMMARY"
93+
fi

0 commit comments

Comments
Β (0)