Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions .github/workflows/on_schedule_regenerate_models.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ jobs:
if: steps.commit.outputs.committed == 'true'
env:
GH_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
WORKFLOW_URL: ${{ github.server_url }}/${{ github.repository }}/actions/workflows/on_schedule_regenerate_models.yaml
WORKFLOW_NAME: ${{ github.workflow }}
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
PREVIOUS_SPEC_VERSION: ${{ steps.previous-spec.outputs.version }}
run: |
SPEC_VERSION=$(uv run python -m scripts.openapi_spec recorded-version)
Expand All @@ -169,19 +170,19 @@ jobs:
# `components/version.yaml` in a follow-up `[skip ci]` commit and a deploy can publish new content under
# the old stamp. Say which case this is instead of letting the reviewer read it as a content identity.
if [[ "$SPEC_VERSION" == "$PREVIOUS_SPEC_VERSION" ]]; then
SPEC_LINE="- Specification version: \`${SPEC_VERSION}\` - **unchanged**, which doesn't rule out a specification change: the published stamp can lag its content by a deploy. Only the diff tells."
SPEC_LINE="- Spec version: \`${SPEC_VERSION}\` (unchanged, but it can lag)."
else
SPEC_LINE="- Specification version: \`${PREVIOUS_SPEC_VERSION}\` -> \`${SPEC_VERSION}\`."
SPEC_LINE="- Spec version: \`${PREVIOUS_SPEC_VERSION}\` -> \`${SPEC_VERSION}\`."
fi

BODY=$(printf '%s\n' \
"- Regenerates the Pydantic models, TypedDicts, and literal aliases from the [published OpenAPI specification](https://docs.apify.com/api/openapi.json), and records its version in \`pyproject.toml\`." \
"- Regenerate Pydantic models, TypedDicts and literal aliases from the" \
" published OpenAPI spec." \
"${SPEC_LINE}" \
"- Retitle to \`fix:\` or \`feat:\` if the diff is user-facing." \
"" \
"> [!IMPORTANT]" \
"> Retitle this pull request to \`fix:\` or \`feat:\` when the diff is user-facing, so that it lands in the changelog and triggers a release - \`chore:\` does neither." \
"" \
"> Generated by the [Regenerate models](${WORKFLOW_URL}) workflow.")
"Generated by the \"${WORKFLOW_NAME}\" workflow:" \
"${RUN_URL}")

gh pr create \
--title "$PR_TITLE" \
Expand Down
Loading