diff --git a/.github/workflows/openapi-ci.yaml b/.github/workflows/openapi-ci.yaml index 948c793086..1c078d7d09 100644 --- a/.github/workflows/openapi-ci.yaml +++ b/.github/workflows/openapi-ci.yaml @@ -120,3 +120,30 @@ jobs: exit 1 fi echo "✓ Bundles have valid sizes" + + trigger-client-model-regeneration: + name: Trigger Python client model regeneration + runs-on: ubuntu-latest + needs: [validate] + if: github.event_name == 'pull_request' + + steps: + - uses: actions/checkout@v6 + + - name: Check if OpenAPI files changed + uses: dorny/paths-filter@v3 + id: filter + with: + filters: | + openapi: + - 'apify-api/openapi/**' + + - name: Trigger apify-client-python model regeneration + if: steps.filter.outputs.openapi == 'true' + run: | + gh workflow run regenerate_models.yaml \ + --repo apify/apify-client-python \ + --field docs_pr_number=${{ github.event.pull_request.number }} \ + --field docs_pr_branch=${{ github.head_ref }} + env: + GITHUB_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}