Skip to content

Commit c72167b

Browse files
Pijukatelclaude
andauthored
docs(openapi): auto-bump OpenAPI version on merge to master when spec changes (#2289)
### Description Adds a GitHub Actions workflow that automatically bumps the `info.version` field in the OpenAPI specification whenever `apify-api/` files are changed and merged to master. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Low risk: documentation/spec and CI automation only, with the main risk being noisy extra commits or workflow misfires on `master` pushes affecting repo history. > > **Overview** > Adds a GitHub Actions workflow (`bump-openapi-version.yaml`) that, on pushes to `master` affecting `apify-api/**`, overwrites `apify-api/openapi/components/version.yaml` with a fresh UTC timestamp and commits it back to the repo. > > Updates `apify-api/openapi/openapi.yaml` to source `info.version` from the new `components/version.yaml` via `$ref`, so the published OpenAPI spec version tracks these automated bumps. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 5d6f5c8. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent bf86dd8 commit c72167b

3 files changed

Lines changed: 32 additions & 1 deletion

File tree

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Bump OpenAPI version
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
paths:
8+
- 'apify-api/**'
9+
10+
jobs:
11+
bump-version:
12+
name: Bump OpenAPI version
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: write
16+
17+
steps:
18+
- uses: actions/checkout@v6
19+
20+
- name: Bump OpenAPI version
21+
run: echo "v2-$(date -u +%Y-%m-%dT%H%M%SZ)" > apify-api/openapi/components/version.yaml
22+
23+
- name: Commit changes
24+
id: commit
25+
uses: EndBug/add-and-commit@v9
26+
with:
27+
author_name: github-actions[bot]
28+
author_email: 41898282+github-actions[bot]@users.noreply.github.com
29+
message: "chore(openapi): Update OpenAPI version [skip ci]"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v2-2026-02-27T074438Z

apify-api/openapi/openapi.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,8 @@ info:
474474
- `~resourcename` - for this, you need to use an API token, and the
475475
`resourcename` refers to a resource in the API token owner's account.
476476
contact: {}
477-
version: ""
477+
version:
478+
$ref: components/version.yaml
478479
servers:
479480
- url: "https://api.apify.com"
480481
variables: {}

0 commit comments

Comments
 (0)