From 1de1b8ad5abdb53e279fa1d2dc599ba98c942dec Mon Sep 17 00:00:00 2001 From: maakle Date: Thu, 19 Feb 2026 11:13:15 +0100 Subject: [PATCH 1/2] Change the workflow file for generating the SDK to directly handle it. --- .github/workflows/sdk_generation.yaml | 88 +++++++++++++++++++++------ 1 file changed, 70 insertions(+), 18 deletions(-) diff --git a/.github/workflows/sdk_generation.yaml b/.github/workflows/sdk_generation.yaml index ae59131..a942f26 100644 --- a/.github/workflows/sdk_generation.yaml +++ b/.github/workflows/sdk_generation.yaml @@ -1,10 +1,8 @@ name: SDK Generation -permissions: - checks: write - contents: write - pull-requests: write - statuses: write -"on": + +permissions: {} + +on: workflow_dispatch: inputs: force: @@ -12,20 +10,74 @@ permissions: type: boolean default: false set_version: - description: optionally set a specific SDK version + description: Optionally set a specific SDK version type: string schedule: - cron: 0 0 * * * + jobs: generate: - uses: speakeasy-api/sdk-generation-action/.github/workflows/workflow-executor.yaml@v15 - with: - force: ${{ github.event.inputs.force }} - mode: pr - set_version: ${{ github.event.inputs.set_version }} - target: kombo-python - secrets: - github_access_token: ${{ secrets.GITHUB_TOKEN }} - openapi_doc_auth_token: ${{ secrets.OPENAPI_DOC_AUTH_TOKEN }} - pypi_token: ${{ secrets.PYPI_TOKEN }} - speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }} + runs-on: ubuntu-latest + outputs: + python_regenerated: ${{ steps.run-workflow.outputs.python_regenerated }} + python_directory: ${{ steps.run-workflow.outputs.python_directory }} + commit_hash: ${{ steps.run-workflow.outputs.commit_hash }} + publish_python: ${{ steps.run-workflow.outputs.publish_python }} + steps: + - name: Generate token + id: app-token + uses: actions/create-github-app-token@v1 + with: + app-id: ${{ secrets.SDK_GENERATOR_GITHUB_APP_ID }} + private-key: ${{ secrets.SDK_GENERATOR_GITHUB_APP_PRIVATE_KEY }} + + - name: Verify token was generated + run: | + if [ -z "${{ steps.app-token.outputs.token }}" ]; then + echo "Error: Token was not generated" + exit 1 + else + echo "Token generated successfully" + fi + + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + token: ${{ steps.app-token.outputs.token }} + + - name: Checkout sdk-generation-action repository + uses: actions/checkout@v4 + with: + repository: speakeasy-api/sdk-generation-action + ref: 788702f013dcd7b0716076b1ce4e5f19be009521 + path: _speakeasy + token: ${{ steps.app-token.outputs.token }} + + - name: Run Generation Workflow + id: run-workflow + uses: ./_speakeasy + with: + speakeasy_version: latest + github_access_token: ${{ steps.app-token.outputs.token }} + mode: pr + force: ${{ github.event.inputs.force }} + speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }} + openapi_doc_auth_token: ${{ secrets.OPENAPI_DOC_AUTH_TOKEN }} + target: kombo-python + enable_sdk_changelog: true + set_version: ${{ github.event.inputs.set_version }} + + - name: Log Generation Output + if: always() + uses: ./_speakeasy + with: + speakeasy_version: latest + github_access_token: ${{ steps.app-token.outputs.token }} + action: log-result + speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }} + env: + GH_ACTION_RESULT: ${{ job.status }} + RESOLVED_SPEAKEASY_VERSION: ${{ steps.run-workflow.outputs.resolved_speakeasy_version }} + GH_ACTION_VERSION: 788702f013dcd7b0716076b1ce4e5f19be009521 + GH_ACTION_STEP: ${{ github.job }} From 07eeac47e6cce094d16b4bff96dadebb23a8cf77 Mon Sep 17 00:00:00 2001 From: maakle Date: Thu, 19 Feb 2026 18:08:19 +0100 Subject: [PATCH 2/2] refactor: Update SDK generation workflow to use the Kombo SDK Generator app and remove unnecessary steps --- .github/workflows/sdk_generation.yaml | 38 +++++++++------------------ 1 file changed, 13 insertions(+), 25 deletions(-) diff --git a/.github/workflows/sdk_generation.yaml b/.github/workflows/sdk_generation.yaml index a942f26..aed4525 100644 --- a/.github/workflows/sdk_generation.yaml +++ b/.github/workflows/sdk_generation.yaml @@ -1,5 +1,6 @@ name: SDK Generation +# We're using custom app authentication below, so we need no permissions. permissions: {} on: @@ -18,11 +19,6 @@ on: jobs: generate: runs-on: ubuntu-latest - outputs: - python_regenerated: ${{ steps.run-workflow.outputs.python_regenerated }} - python_directory: ${{ steps.run-workflow.outputs.python_directory }} - commit_hash: ${{ steps.run-workflow.outputs.commit_hash }} - publish_python: ${{ steps.run-workflow.outputs.publish_python }} steps: - name: Generate token id: app-token @@ -31,32 +27,24 @@ jobs: app-id: ${{ secrets.SDK_GENERATOR_GITHUB_APP_ID }} private-key: ${{ secrets.SDK_GENERATOR_GITHUB_APP_PRIVATE_KEY }} - - name: Verify token was generated - run: | - if [ -z "${{ steps.app-token.outputs.token }}" ]; then - echo "Error: Token was not generated" - exit 1 - else - echo "Token generated successfully" - fi - - name: Checkout repository uses: actions/checkout@v4 with: fetch-depth: 0 token: ${{ steps.app-token.outputs.token }} - - name: Checkout sdk-generation-action repository - uses: actions/checkout@v4 - with: - repository: speakeasy-api/sdk-generation-action - ref: 788702f013dcd7b0716076b1ce4e5f19be009521 - path: _speakeasy - token: ${{ steps.app-token.outputs.token }} - + # We're using the "Kombo SDK Generator" GitHub App because this way, the + # created PRs can trigger other workflows (specifically the test suite we + # always want to run). + # + # See GitHub docs on limitation: + # https://docs.github.com/en/actions/how-tos/write-workflows/choose-when-workflows-run/trigger-a-workflow-from-a-workflow + # + # See config of the app: + # https://github.com/organizations/kombohq/settings/apps/kombo-sdk-generator - name: Run Generation Workflow id: run-workflow - uses: ./_speakeasy + uses: speakeasy-api/sdk-generation-action@v15 with: speakeasy_version: latest github_access_token: ${{ steps.app-token.outputs.token }} @@ -70,7 +58,7 @@ jobs: - name: Log Generation Output if: always() - uses: ./_speakeasy + uses: speakeasy-api/sdk-generation-action@v15 with: speakeasy_version: latest github_access_token: ${{ steps.app-token.outputs.token }} @@ -79,5 +67,5 @@ jobs: env: GH_ACTION_RESULT: ${{ job.status }} RESOLVED_SPEAKEASY_VERSION: ${{ steps.run-workflow.outputs.resolved_speakeasy_version }} - GH_ACTION_VERSION: 788702f013dcd7b0716076b1ce4e5f19be009521 + GH_ACTION_VERSION: v15 GH_ACTION_STEP: ${{ github.job }}