@@ -63,20 +63,15 @@ jobs:
6363 with :
6464 token : ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
6565
66- # If the branch already exists on the remote (e.g. from a previous run, possibly with reviewer
67- # commits), check it out so regeneration builds on top of it. Otherwise stay on the default
68- # branch and let the signed-commit step below create the remote branch — its create-branch
69- # flow does `git fetch ... $BRANCH:refs/heads/$BRANCH` which fails if $BRANCH is already
70- # checked out locally.
71- - name : Set up branch
72- id : branch-setup
66+ # If the branch already exists on the remote (e.g. from a previous run, possibly with reviewer commits),
67+ # check it out to build on top of it instead of starting fresh.
68+ - name : Switch to existing branch or create a new one
7369 run : |
7470 if git ls-remote --exit-code --heads origin "$BRANCH" > /dev/null 2>&1; then
75- git fetch origin "$BRANCH":"$BRANCH"
71+ git fetch origin "$BRANCH"
7672 git switch "$BRANCH"
77- echo "create_branch=false" >> "$GITHUB_OUTPUT"
7873 else
79- echo "create_branch=true" >> "$GITHUB_OUTPUT "
74+ git switch -c "$BRANCH "
8075 fi
8176
8277 # Download the pre-built OpenAPI spec artifact from the apify-docs workflow run.
@@ -117,7 +112,7 @@ jobs:
117112 add : ' src/apify_client/_models.py src/apify_client/_typeddicts.py src/apify_client/_literals.py'
118113 github-token : ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
119114 branch : ${{ env.BRANCH }}
120- create-branch : ${{ steps.branch-setup.outputs.create_branch }}
115+ create-branch : ' true '
121116
122117 - name : Create or update PR
123118 if : steps.commit.outputs.committed == 'true'
0 commit comments