Skip to content
Merged
Show file tree
Hide file tree
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
29 changes: 29 additions & 0 deletions .github/workflows/bump-openapi-version.yaml
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
Comment on lines +14 to +15
Copy link
Copy Markdown
Member

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


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
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need a third-party action for what is essentially git add, git commit and git push? With the recent increase in supply chain attacks, I would be wary of this.

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The 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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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 git config (etc.), scattered around our workflows and it was hard to understand what the intention was.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The 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:

steps:
- uses: actions/checkout@v6
  with:
    token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}

- run: echo "abcd" > somewhere.txt

- run: |
    git add .
    git commit -m "Some changes"
    git push

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, you're missing the two git config commands, but yeah, it is easy enough. The bad part is that with time, this will get interleaved with other steps in the same job and become harder and harder to adjust.

Copy link
Copy Markdown
Member

@fnesveda fnesveda Feb 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are they really necessary? If we're using the APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN, won't the commits get correctly attributed to the Apify Service Account?

with:
author_name: github-actions[bot]
author_email: 41898282+github-actions[bot]@users.noreply.github.com
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks a bit suspicious, how did you come up with that?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, carry on then 😁

message: "chore(openapi): Update OpenAPI version [skip ci]"
1 change: 1 addition & 0 deletions apify-api/openapi/components/version.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v2-2026-02-27T074438Z
3 changes: 2 additions & 1 deletion apify-api/openapi/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,8 @@ info:
- `~resourcename` - for this, you need to use an API token, and the
`resourcename` refers to a resource in the API token owner's account.
contact: {}
version: ""
version:
$ref: components/version.yaml
servers:
- url: "https://api.apify.com"
variables: {}
Expand Down