{"id":30237954,"url":"https://github.com/stainless-api/build-sdk-action","last_synced_at":"2025-10-13T14:38:14.162Z","repository":{"id":272370564,"uuid":"916287774","full_name":"stainless-api/build-sdk-action","owner":"stainless-api","description":null,"archived":true,"fork":false,"pushed_at":"2025-07-09T21:48:14.000Z","size":8153,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-01T00:42:01.027Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stainless-api.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-01-13T20:06:19.000Z","updated_at":"2025-09-25T14:32:54.000Z","dependencies_parsed_at":"2025-04-29T23:19:33.952Z","dependency_job_id":"78c6c4d9-1a2a-42ae-aa82-c51d3fd801a4","html_url":"https://github.com/stainless-api/build-sdk-action","commit_stats":null,"previous_names":["stainless-api/build-sdk-action"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/stainless-api/build-sdk-action","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stainless-api%2Fbuild-sdk-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stainless-api%2Fbuild-sdk-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stainless-api%2Fbuild-sdk-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stainless-api%2Fbuild-sdk-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stainless-api","download_url":"https://codeload.github.com/stainless-api/build-sdk-action/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stainless-api%2Fbuild-sdk-action/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279015771,"owners_count":26085748,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-08-15T02:58:06.933Z","updated_at":"2025-10-13T14:38:14.131Z","avatar_url":"https://github.com/stainless-api.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Build Stainless SDKs from GitHub Actions\n\n\u003e [!WARNING]\n\u003e This GitHub action has been moved to [`upload-openapi-spec-action`](https://github.com/stainless-api/upload-openapi-spec-action).\n\u003e Migrate by renaming the following:\n\u003e - `build-sdk-action@any` → `upload-openapi-spec-action/build@v1`\n\u003e - `build-sdk-action/preview@any` → `upload-openapi-spec-action/preview@v1`\n\u003e - `build-sdk-action/merge@any` → `upload-openapi-spec-action/merge@v1`\n\u003e\n\u003e This action will no longer receive updates.\n\nGitHub Actions for building [Stainless](https://stainless.com/) SDKs and\npreviewing changes to an SDK from a pull request.\n\n## Usage\n\nGet an API key from your Stainless organization dashboard. In the GitHub\nrepository that stores your ground truth OpenAPI spec, add the key to the\n[repository secrets](https://docs.github.com/en/actions/security-for-github-actions/security-guides/using-secrets-in-github-actions#creating-secrets-for-a-repository)\nwith the name `STAINLESS_API_KEY`. You can do this with the GitHub CLI via:\n\n```bash\ngh secret set STAINLESS_API_KEY\n```\n\nIn the same repository, add a new workflow file:\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003ccode\u003e.github/workflows/stainless.yml\u003c/code\u003e\u003c/summary\u003e\n\n```yml\nname: Build SDKs for pull request\n\non:\n  pull_request:\n    types:\n      - opened\n      - synchronize\n      - reopened\n      - closed\n\nconcurrency:\n  group: ${{ github.workflow }}-${{ github.event.pull_request.number }}\n  cancel-in-progress: true\n\nenv:\n  STAINLESS_ORG: YOUR_ORG\n  STAINLESS_PROJECT: YOUR_PROJECT\n  OAS_PATH: YOUR_OAS_PATH\n  COMMIT_MESSAGE: ${{ github.event.pull_request.title }}\n\njobs:\n  preview:\n    if: github.event.action != 'closed'\n    runs-on: ubuntu-latest\n    permissions:\n      contents: read\n      pull-requests: write\n    steps:\n      - name: Checkout repository\n        uses: actions/checkout@v4\n        with:\n          fetch-depth: 2\n\n      - name: Run preview builds\n        uses: stainless-api/build-sdk-action/preview@3fa5f068d05f51899b2903965e0ec395743d005f\n        with:\n          stainless_api_key: ${{ secrets.STAINLESS_API_KEY }}\n          org: ${{ env.STAINLESS_ORG }}\n          project: ${{ env.STAINLESS_PROJECT }}\n          oas_path: ${{ env.OAS_PATH }}\n          commit_message: ${{ env.COMMIT_MESSAGE }}\n\n  merge:\n    if: github.event.action == 'closed' \u0026\u0026 github.event.pull_request.merged == true\n    runs-on: ubuntu-latest\n    permissions:\n      contents: read\n      pull-requests: write\n    steps:\n      - name: Checkout repository\n        uses: actions/checkout@v4\n        with:\n          fetch-depth: 2\n\n      - name: Run merge build\n        uses: stainless-api/build-sdk-action/merge@3fa5f068d05f51899b2903965e0ec395743d005f\n        with:\n          stainless_api_key: ${{ secrets.STAINLESS_API_KEY }}\n          org: ${{ env.STAINLESS_ORG }}\n          project: ${{ env.STAINLESS_PROJECT }}\n          oas_path: ${{ env.OAS_PATH }}\n          commit_message: ${{ env.COMMIT_MESSAGE }}\n```\n\u003c/details\u003e\n\nThen, pull requests to your GitHub repository that update OpenAPI spec or\nStainless config will build your SDKs and make a comment with the results.\n\nFor more details about the input parameters, see the\n[example workflow](./examples/pull_request.yml) file.\n\nFor more examples of usage, including push-based workflows, using code samples,\nand integration with docs platforms, see the [examples directory](./examples).\n\n## Actions\n\nThis repository provides three GitHub actions.\n\n- `stainless-api/build-sdk-action`: Build SDKs for a Stainless project. For\ninformation about the input parameters, see the [action definition](./action.yml).\n\n- `stainless-api/build-sdk-action/preview`: Preview changes to SDKs introduced\nby a pull request. For information about the input parameters, see the\n[action definition](./preview/action.yml).\n\n- `stainless-api/build-sdk-action/merge`: Merge changes to SDKs from a pull\nrequest. For information about the input parameters, see the\n[action definition](./merge/action.yml).\n\n### Workflow permissions\n\nThe GitHub actions use the following\n[workflow permissions](https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#jobsjob_idpermissions):\n\n- The `preview` and `merge` actions have a `make_comment` input, which, if set,\nwill comment on the pull request with the build results. This is set to true by\ndefault. The actions use the `github_token` input to make a comment, and the\ncomment must have the `pull-requests: write` permission.\n\n- The `preview` action relies on being in a Git repository that can fetch from\nthe remote to determine base revisions. This will be the case if you use the\n[`actions/checkout`](https://github.com/actions/checkout) GitHub action\nbeforehand. That action needs the `contents: read` permission.\n\n### Versioning policy\n\nThis action is in public beta, and breaking changes may be introduced in any\ncommit. We recommend pinning your actions to a full-length commit SHA to avoid\npotential breaking changes.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstainless-api%2Fbuild-sdk-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstainless-api%2Fbuild-sdk-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstainless-api%2Fbuild-sdk-action/lists"}