Skip to content

Commit fdc553e

Browse files
vdusekclaude
andauthored
ci: Make regenerated-models comment on docs PRs more visible (#748)
## Summary The `manual_regenerate_models` workflow posts a cross-repo comment on the source `apify-docs` PR whenever a companion `apify-client-python` PR is opened or updated. Some authors have been ignoring it, which leaves the Python client out of sync with the OpenAPI spec. This PR makes the comment harder to miss: - Uses a GitHub `[!IMPORTANT]` alert block so it renders as a highlighted callout. - Adds an `@mention` of the docs PR author (passed in via the new `docs_pr_author` workflow input) so they get a direct notification. - Rewrites the body with an explicit "Action required" headline and a short action checklist (review & merge both PRs together, ping the Tooling team if needed). - Minor cleanup: comment/docstring wording in the workflow file. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent c25f749 commit fdc553e

1 file changed

Lines changed: 22 additions & 7 deletions

File tree

.github/workflows/manual_regenerate_models.yaml

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This workflow regenerates Pydantic models (src/apify_client/_models.py) from the OpenAPI spec.
22
#
33
# It can be triggered in two ways:
4-
# 1. Automatically via workflow_dispatch from the apify-docs CI pipeline (with docs_pr_number and docs_workflow_run_id).
4+
# 1. Automatically via workflow_dispatch from the apify-docs CI pipeline.
55
# 2. Manually from the GitHub UI (without any inputs) to regenerate from the live published spec.
66

77
name: Regenerate models
@@ -63,8 +63,8 @@ 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
67-
# reviewer commits), check it out to build on top of it instead of starting fresh.
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.
6868
- name: Switch to existing branch or create a new one
6969
run: |
7070
if git ls-remote --exit-code --heads origin "$BRANCH" > /dev/null 2>&1; then
@@ -155,15 +155,30 @@ jobs:
155155
GH_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
156156
PR_CREATED: ${{ steps.pr.outputs.created }}
157157
PR_URL: ${{ steps.pr.outputs.pr_url }}
158+
DOCS_PR_AUTHOR: ${{ inputs.docs_pr_author }}
158159
run: |
159-
if [[ "$PR_CREATED" = "true" ]]; then
160-
COMMENT="A PR to update the Python client models has been created: ${PR_URL}
160+
MENTION=""
161+
if [[ -n "$DOCS_PR_AUTHOR" ]]; then
162+
MENTION="@${DOCS_PR_AUTHOR} "
163+
fi
161164
162-
This was automatically triggered by OpenAPI specification changes in this PR."
165+
if [[ "$PR_CREATED" = "true" ]]; then
166+
HEADLINE="A companion PR has been opened in \`apify-client-python\` with the regenerated models: ${PR_URL}"
163167
else
164-
COMMENT="The Python client model PR has been updated with the latest OpenAPI spec changes: ${PR_URL}"
168+
HEADLINE="The companion \`apify-client-python\` PR has been updated with the latest spec changes: ${PR_URL}"
165169
fi
166170
171+
COMMENT=$(printf '%s\n' \
172+
"> [!IMPORTANT]" \
173+
"> **Action required** — ${MENTION}please coordinate this docs PR with the Python API client PR linked below." \
174+
">" \
175+
"> Because this PR modifies the OpenAPI specification, the generated models in \`apify-client-python\` must be regenerated to stay in sync. This has already been done automatically:" \
176+
">" \
177+
"> ${HEADLINE}" \
178+
">" \
179+
"> - Please make sure to review and merge both PRs together to keep the OpenAPI spec and API clients in sync." \
180+
"> - You can ask for review and help from the Tooling team if needed.")
181+
167182
gh pr comment "$DOCS_PR_NUMBER" \
168183
--repo apify/apify-docs \
169184
--body "$COMMENT"

0 commit comments

Comments
 (0)