Update stubs workflow.

This commit is contained in:
Robin Huang 2025-04-21 23:42:20 -07:00
parent 280997b383
commit 14cf25ee0f

View File

@ -1,11 +1,9 @@
name: Generate API Models name: Generate Pydantic Stubs from api.comfy.org
on: on:
schedule: schedule:
# Run weekly on Monday at 00:00 UTC
- cron: '0 0 * * 1' - cron: '0 0 * * 1'
workflow_dispatch: workflow_dispatch:
# Allow manual triggering
jobs: jobs:
generate-models: generate-models:
@ -27,23 +25,23 @@ jobs:
- name: Generate API models - name: Generate API models
run: | run: |
datamodel-codegen --use-subclass-enum --url https://stagingapi.comfy.org/openapi --output comfy_api_nodes/apis/stubs.py datamodel-codegen --use-subclass-enum --url https://api.comfy.org/openapi --output comfy_api_nodes/apis/stubs.py
- name: Check for changes - name: Check for changes
id: git-check id: git-check
run: | run: |
git diff --exit-code comfy_extras/apis/stubs.py || echo "changes=true" >> $GITHUB_OUTPUT git diff --exit-code comfy_api_nodes/apis/stubs.py || echo "changes=true" >> $GITHUB_OUTPUT
- name: Create Pull Request - name: Create Pull Request
if: steps.git-check.outputs.changes == 'true' if: steps.git-check.outputs.changes == 'true'
uses: peter-evans/create-pull-request@v5 uses: peter-evans/create-pull-request@v5
with: with:
commit-message: 'chore: update API models from OpenAPI spec' commit-message: 'chore: update API models from OpenAPI spec'
title: 'Update API models from OpenAPI spec' title: 'Update API models from api.comfy.org'
body: | body: |
This PR updates the API models based on the latest OpenAPI specification. This PR updates the API models based on the latest api.comfy.org OpenAPI specification.
Generated automatically by the Generate API Models workflow. Generated automatically by the a Github workflow.
branch: update-api-models branch: update-api-stubs
delete-branch: true delete-branch: true
base: main base: main