From 74498618a3d5dac8e68e13fdd817f03bae381b7c Mon Sep 17 00:00:00 2001 From: Vlada Dusek Date: Wed, 20 May 2026 17:10:02 +0200 Subject: [PATCH 1/2] fix: repair regenerate-models workflow stale add glob and branch clash The `add:` pathspec `_*_generated.py` stopped matching anything after the generated files were renamed (PR #765 dropped the `_generated` suffix), so the workflow has been silently producing no commits since 2026-04-29. After PR #792 swapped to `apify/actions/signed-commit`, the pre-existing local `git switch -c "$BRANCH"` step also clashed with the action's `create-branch: true` flow (its `git fetch ... $BRANCH:refs/heads/$BRANCH` refuses to overwrite a checked-out branch), leaving dangling empty branches like `update-models-docs-pr-2546` / `-2548`. This fixes the `add:` list to the actual filenames and skips the local branch creation when the remote branch doesn't yet exist, letting signed-commit handle that path; existing branches are still pre-checked-out locally and `create-branch` is set to `false` for that case. --- .../workflows/manual_regenerate_models.yaml | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/.github/workflows/manual_regenerate_models.yaml b/.github/workflows/manual_regenerate_models.yaml index 93433ab9..2db60d7b 100644 --- a/.github/workflows/manual_regenerate_models.yaml +++ b/.github/workflows/manual_regenerate_models.yaml @@ -1,4 +1,4 @@ -# This workflow regenerates Pydantic models and TypedDicts (src/apify_client/_{models,typeddicts}_generated.py) from the OpenAPI spec. +# This workflow regenerates Pydantic models, TypedDicts, and Literal aliases (src/apify_client/_{models,typeddicts,literals}.py) from the OpenAPI spec. # # It can be triggered in two ways: # 1. Automatically via workflow_dispatch from the apify-docs CI pipeline. @@ -63,15 +63,20 @@ jobs: with: token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }} - # If the branch already exists on the remote (e.g. from a previous run, possibly with reviewer commits), - # check it out to build on top of it instead of starting fresh. - - name: Switch to existing branch or create a new one + # If the branch already exists on the remote (e.g. from a previous run, possibly with reviewer + # commits), check it out so regeneration builds on top of it. Otherwise stay on the default + # branch and let the signed-commit step below create the remote branch — its create-branch + # flow does `git fetch ... $BRANCH:refs/heads/$BRANCH` which fails if $BRANCH is already + # checked out locally. + - name: Set up branch + id: branch-setup run: | if git ls-remote --exit-code --heads origin "$BRANCH" > /dev/null 2>&1; then - git fetch origin "$BRANCH" + git fetch origin "$BRANCH":"$BRANCH" git switch "$BRANCH" + echo "create_branch=false" >> "$GITHUB_OUTPUT" else - git switch -c "$BRANCH" + echo "create_branch=true" >> "$GITHUB_OUTPUT" fi # Download the pre-built OpenAPI spec artifact from the apify-docs workflow run. @@ -109,10 +114,10 @@ jobs: uses: apify/actions/signed-commit@v1.0.0 with: message: ${{ env.TITLE }} - add: 'src/apify_client/_*_generated.py' + add: 'src/apify_client/_models.py src/apify_client/_typeddicts.py src/apify_client/_literals.py' github-token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }} branch: ${{ env.BRANCH }} - create-branch: 'true' + create-branch: ${{ steps.branch-setup.outputs.create_branch }} - name: Create or update PR if: steps.commit.outputs.committed == 'true' From 6f4ee032f2151dc76edd9bdcbc70ed6b0f5ac481 Mon Sep 17 00:00:00 2001 From: Vlada Dusek Date: Thu, 21 May 2026 18:28:24 +0200 Subject: [PATCH 2/2] ci: drop branch-setup changes, focus PR on the add glob fix Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/manual_regenerate_models.yaml | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/.github/workflows/manual_regenerate_models.yaml b/.github/workflows/manual_regenerate_models.yaml index 2db60d7b..0c270eaf 100644 --- a/.github/workflows/manual_regenerate_models.yaml +++ b/.github/workflows/manual_regenerate_models.yaml @@ -63,20 +63,15 @@ jobs: with: token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }} - # If the branch already exists on the remote (e.g. from a previous run, possibly with reviewer - # commits), check it out so regeneration builds on top of it. Otherwise stay on the default - # branch and let the signed-commit step below create the remote branch — its create-branch - # flow does `git fetch ... $BRANCH:refs/heads/$BRANCH` which fails if $BRANCH is already - # checked out locally. - - name: Set up branch - id: branch-setup + # If the branch already exists on the remote (e.g. from a previous run, possibly with reviewer commits), + # check it out to build on top of it instead of starting fresh. + - name: Switch to existing branch or create a new one run: | if git ls-remote --exit-code --heads origin "$BRANCH" > /dev/null 2>&1; then - git fetch origin "$BRANCH":"$BRANCH" + git fetch origin "$BRANCH" git switch "$BRANCH" - echo "create_branch=false" >> "$GITHUB_OUTPUT" else - echo "create_branch=true" >> "$GITHUB_OUTPUT" + git switch -c "$BRANCH" fi # Download the pre-built OpenAPI spec artifact from the apify-docs workflow run. @@ -117,7 +112,7 @@ jobs: add: 'src/apify_client/_models.py src/apify_client/_typeddicts.py src/apify_client/_literals.py' github-token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }} branch: ${{ env.BRANCH }} - create-branch: ${{ steps.branch-setup.outputs.create_branch }} + create-branch: 'true' - name: Create or update PR if: steps.commit.outputs.committed == 'true'