Skip to content

Commit f928162

Browse files
vdusekclaude
andauthored
ci: Pass PR author to client regeneration and fix cleanup conditions (#2406)
## Summary - Pass docs PR author to apify-client-python workflow for assignee resolution - Only close the client model PR when the docs PR is closed without merging Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 23a6b3f commit f928162

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

.github/workflows/openapi-ci.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,20 +148,24 @@ jobs:
148148
env:
149149
GITHUB_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
150150
PR_NUMBER: ${{ github.event.pull_request.number }}
151+
PR_AUTHOR: ${{ github.event.pull_request.user.login }}
151152
run: |
152153
gh workflow run manual_regenerate_models.yaml \
153154
--repo apify/apify-client-python \
154155
--field docs_pr_number="$PR_NUMBER" \
155-
--field docs_workflow_run_id="${{ github.run_id }}"
156+
--field docs_workflow_run_id="${{ github.run_id }}" \
157+
--field docs_pr_author="$PR_AUTHOR"
156158
157-
# When a docs PR is closed (merged or abandoned), clean up the corresponding auto-generated PR
159+
# When a docs PR is closed without being merged, clean up the corresponding auto-generated PR
158160
# in apify-client-python to avoid stale PRs piling up.
161+
# If the docs PR is merged, the client PR is left open for manual review and merge.
159162
cleanup-client-model-pr:
160163
name: Close Python client model PR on docs PR close
161164
runs-on: ubuntu-latest
162165
if: >-
163166
github.event_name == 'pull_request'
164167
&& github.event.action == 'closed'
168+
&& github.event.pull_request.merged == false
165169
&& github.event.pull_request.head.repo.full_name == github.repository
166170
167171
steps:
@@ -182,7 +186,7 @@ jobs:
182186
gh pr close "$EXISTING_PR" \
183187
--repo apify/apify-client-python \
184188
--delete-branch \
185-
--comment "Closing this PR because the source apify-docs PR #${PR_NUMBER} was closed."
189+
--comment "Closing this PR because the source apify-docs PR #${PR_NUMBER} was closed without merging."
186190
echo "Closed apify-client-python PR #$EXISTING_PR"
187191
else
188192
echo "No corresponding apify-client-python PR found for branch $BRANCH"

0 commit comments

Comments
 (0)