-
Notifications
You must be signed in to change notification settings - Fork 180
docs(openapi): auto-bump OpenAPI version on merge to master when spec changes #2289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
d676c10
e718fa9
0c91132
125ac88
5d6f5c8
de24ca7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| name: Bump OpenAPI version | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - master | ||
| paths: | ||
| - 'apify-api/**' | ||
|
|
||
| jobs: | ||
| bump-version: | ||
| name: Bump OpenAPI version | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v6 | ||
|
|
||
| - name: Bump OpenAPI version | ||
| run: echo "v2-$(date -u +%Y-%m-%dT%H%M%SZ)" > apify-api/openapi/components/version.yaml | ||
|
|
||
| - name: Commit changes | ||
| id: commit | ||
| uses: EndBug/add-and-commit@v9 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need a third-party action for what is essentially I know we're using them pretty liberally right now, but supply chain security is something we want to focus on soon, so when we can, let's not add unnecessary dependencies.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also in this repository we're already using a different third-party action to do the same thing, so if anything, we should at least use the same one 😄 https://github.com/apify/apify-docs/blob/master/.github/workflows/publish-to-npm.yaml#L97-L99
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Most of our repos use the one used here. The motivation is that before migrating to this, we had
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Alright, let's keep it like this for now, and then later discuss this globally and decide how to proceed. But IMHO it's not that complicated to do it without any third-party actions:
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well, you're missing the two
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are they really necessary? If we're using the |
||
| with: | ||
| author_name: github-actions[bot] | ||
| author_email: 41898282+github-actions[bot]@users.noreply.github.com | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This looks a bit suspicious, how did you come up with that?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I copied this from the workflow repo
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK, carry on then 😁 |
||
| message: "chore(openapi): Update OpenAPI version [skip ci]" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| v2-2026-02-27T074438Z |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not 100% sure this will work, I think you won't get permissions to push to the repo like this.
If it doesn't, try using the service account token during checkout:
https://github.com/apify/apify-docs/blob/master/.github/workflows/publish-to-npm.yaml#L48-L51