Skip to content

chore: Separate api-docs PR and trigger another workflow for it#1718

Open
emincihangeri wants to merge 41 commits intomainfrom
chore-separate-docs-prs
Open

chore: Separate api-docs PR and trigger another workflow for it#1718
emincihangeri wants to merge 41 commits intomainfrom
chore-separate-docs-prs

Conversation

@emincihangeri
Copy link
Copy Markdown
Contributor

Context

Closes SAP/ai-sdk-js-backlog#453.

What this PR does and why it is needed

@hyperspace-insights
Copy link
Copy Markdown
Contributor

Summary

The following content is AI-generated and provides a summary of the pull request:


Separate API Docs PR from Release Notes Workflow

Refactor

♻️ Decoupled the API documentation generation from the release notes workflow. Previously, API docs and release notes were bundled into a single PR during the release bump. They are now handled as two separate, independent PRs — improving modularity and allowing each to be triggered and merged independently.

Changes

  • .github/workflows/api-docs.yml: Refactored into a reusable workflow supporting both workflow_call (triggered from bump.yml) and workflow_dispatch (manual trigger). Replaced SSH-based git cloning with actions/checkout, switched to GH_CLOUD_SDK_JS_ADMIN_WRITE_TOKEN for authentication, and streamlined the steps for copying docs, creating a branch, and opening a dedicated API docs PR in the SAP/ai-sdk repository.

  • .github/workflows/bump.yml: Split the former prepare-release-notes-and-docs job into two separate jobs:

    • prepare-release-notes: Now only handles release notes (removes API doc generation and copying steps).
    • generate-api-docs: New job that calls the reusable api-docs.yml workflow after the bump, passing the version as input.
  • .github/workflows/publish-release.yml: Renamed check-docs-prcheck-release-notes-pr and merge-docs-prmerge-release-notes-pr, along with all associated output variable and step name references, to reflect that this workflow now exclusively manages the release notes PR lifecycle.


  • 🔄 Regenerate and Update Summary
  • ✏️ Insert as PR Description (deletes this comment)
  • 🗑️ Delete comment
PR Bot Information

Version: 1.20.0 | 📖 Documentation | 🚨 Create Incident | 💬 Feedback


💌 Have ideas or want to contribute? Create an issue and share your thoughts with us!
📑 Check out the documentation for more information.
📬 Subscribe to the Hyperspace PR Bot DL to get the latest announcements and pilot features!

Made with ❤️ by Hyperspace.

@emincihangeri emincihangeri changed the title chore: Seperate api-docs PR and trigger another workflow for it chore: Separate api-docs PR and trigger another workflow for it Apr 7, 2026
@emincihangeri emincihangeri requested a review from marikaner April 7, 2026 12:17
Comment thread .github/workflows/api-docs.yml Outdated
inputs:
version:
description: 'Version to generate docs for (e.g., 2.9.0). Only the major version is used for the target folder (e.g., v2).'
description: 'Version to generate docs for (e.g., 2.9.0).'
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.

[q] Why do we even have to pass a version? Can't we take what is in the package.json?

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.

This could be useful in very rare cases that there is something needs to be fixed in the API docs after a bump for a specific version but I am not sure if it is a must. :/

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.

Then this could be an optional field.

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.

[req] You need to handle the case if nothing was passed still. I think there is a script to get the version from package.json. If not, I think this can be very easily be done on the command line.

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.

Otherwise, this is the result: SAP/ai-sdk#459

Comment thread .github/workflows/api-docs.yml Outdated
Comment thread .github/workflows/api-docs.yml Outdated
Comment thread .github/workflows/bump.yml Outdated
Co-authored-by: Marika Marszalkowski <marika.marszalkowski@sap.com>
Comment thread .github/workflows/api-docs.yml Outdated
Copy link
Copy Markdown
Contributor

@marikaner marikaner left a comment

Choose a reason for hiding this comment

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

We should remove the non-existent token + env variable, everything else is details, but would be nice to have before merging.

Comment thread .github/workflows/api-docs.yml Outdated
Comment thread .github/workflows/publish-release.yml Outdated
Comment thread .github/workflows/publish-release.yml Outdated
Comment thread .github/workflows/publish-release.yml Outdated
Comment thread .github/workflows/publish-release.yml Outdated
Comment thread .github/workflows/api-docs.yml Outdated
inputs:
version:
description: 'Version to generate docs for (e.g., 2.9.0). Only the major version is used for the target folder (e.g., v2).'
description: 'Version to generate docs for (e.g., 2.9.0).'
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.

[req] You need to handle the case if nothing was passed still. I think there is a script to get the version from package.json. If not, I think this can be very easily be done on the command line.

Comment thread .github/workflows/api-docs.yml Outdated
inputs:
version:
description: 'Version to generate docs for (e.g., 2.9.0). Only the major version is used for the target folder (e.g., v2).'
description: 'Version to generate docs for (e.g., 2.9.0).'
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.

Otherwise, this is the result: SAP/ai-sdk#459

Comment thread .github/workflows/api-docs.yml Outdated
Comment thread .github/workflows/bump.yml Outdated
Comment thread .github/workflows/bump.yml Outdated
Comment thread .github/workflows/api-docs.yml Outdated
Comment on lines 6 to 10
inputs:
version:
description: 'Version to generate docs for (e.g., 2.9.0). Only the major version is used for the target folder (e.g., v2).'
description: 'Version to generate docs for (e.g., 2.9.0).'
required: true
type: string
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.

[req] After reviewing this once more, I noticed that you don't use the version for anything different than the branch name and title of the PR and commit. As discussed, you fixed this for the workflow_dispatch, but not the workflow_call.
When you call the workflow from bump as is right now, yes, you are not running on the bumped version, but on the state of main pre bump (https://docs.github.com/en/enterprise-server@3.19/actions/how-tos/reuse-automations/reuse-workflows?utm_source=chatgpt.com#calling-a-reusable-workflow). But changing the title of the api-docs commit, won't change that.

See my comments in bump for suggestions.

Comment thread .github/workflows/bump.yml Outdated
Comment on lines +118 to +124
generate-api-docs:
name: Generate and Push API Documentation
needs: [bump]
uses: ./.github/workflows/api-docs.yml
secrets: inherit
with:
version: ${{ needs.bump.outputs.version }}
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.

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.

I tried to implement with the 2nd option now. Looks more clean.

Copy link
Copy Markdown
Contributor

@marikaner marikaner left a comment

Choose a reason for hiding this comment

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

one more thought: I think it would be even better, if you made a reusable create-api-docs-pr action. Then you could use that directly in the api-docs.yml and bump.yml

emincihangeri and others added 2 commits April 23, 2026 13:32
Co-authored-by: Marika Marszalkowski <marika.marszalkowski@sap.com>
Co-authored-by: Marika Marszalkowski <marika.marszalkowski@sap.com>
@emincihangeri
Copy link
Copy Markdown
Contributor Author

one more thought: I think it would be even better, if you made a reusable create-api-docs-pr action. Then you could use that directly in the api-docs.yml and bump.yml

So the bump workflow calling the api-docs.yml will no longer be the logic? but we still want to have the api-docs.yml for manual triggering then, right?

Copy link
Copy Markdown
Contributor

@marikaner marikaner left a comment

Choose a reason for hiding this comment

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

I still have some requests. I think it was not necessary to move the api-docs implementation to an action (my bad) but it is a good idea, if we want to align this between Cloud SDK and AI SDK, so let's keep it as is.

Comment thread .github/actions/create-api-docs-pr/action.yml Outdated
Comment on lines +71 to +77
if git commit -m 'Update SAP AI SDK for JavaScript API documentation v${{ steps.version.outputs.major-version }}'; then
git push -u origin "$BRANCH_NAME"
echo "pushed=true" >> "$GITHUB_OUTPUT"
else
echo "No changes to commit. Skipping push."
echo "pushed=false" >> "$GITHUB_OUTPUT"
fi
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.

[req] I think the if else conditions here are redundant. We already have the check whether there are changes. If there are no changes, we never enter this step. So it would suffice to do the if block and not create a GITHUB_OUTPUT.

fi

- name: Create pull request
if: steps.check-changes.outputs.docs == 'true' && steps.commit-push.outputs.pushed == 'true'
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.

Suggested change
if: steps.check-changes.outputs.docs == 'true' && steps.commit-push.outputs.pushed == 'true'
if: steps.check-changes.outputs.docs == 'true'

Comment thread .github/actions/create-api-docs-pr/action.yml Outdated
Comment thread .github/workflows/bump.yml Outdated
Comment thread .github/workflows/bump.yml Outdated
davidkna-sap and others added 6 commits April 27, 2026 16:20
Co-authored-by: Marika Marszalkowski <marika.marszalkowski@sap.com>
Co-authored-by: Marika Marszalkowski <marika.marszalkowski@sap.com>
Co-authored-by: Marika Marszalkowski <marika.marszalkowski@sap.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants