mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-22 15:36:16 +00:00
Bumps [stainless-api/upload-openapi-spec-action](https://github.com/stainless-api/upload-openapi-spec-action) from 1.7.1 to 1.8.1. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/stainless-api/upload-openapi-spec-action/releases">stainless-api/upload-openapi-spec-action's releases</a>.</em></p> <blockquote> <h2>v1.8.1</h2> <h2><a href="https://github.com/stainless-api/upload-openapi-spec-action/compare/v1.8.0...v1.8.1">1.8.1</a> (2025-12-09)</h2> <h3>Bug Fixes</h3> <ul> <li>re-enable 'targets' param in diagnostics call (<a href="https://redirect.github.com/stainless-api/upload-openapi-spec-action/issues/148">#148</a>) (<a href="3130e17c92">3130e17</a>)</li> </ul> <h2>v1.8.0</h2> <h2><a href="https://github.com/stainless-api/upload-openapi-spec-action/compare/v1.7.1...v1.8.0">1.8.0</a> (2025-12-08)</h2> <h3>Features</h3> <ul> <li>support AI commit message generation for preview builds (<a href="https://redirect.github.com/stainless-api/upload-openapi-spec-action/issues/143">#143</a>) (<a href="7010edb389">7010edb</a>)</li> <li>support per-SDK commit messages in preview comments (<a href="https://redirect.github.com/stainless-api/upload-openapi-spec-action/issues/142">#142</a>) (<a href="a36c33fc21">a36c33f</a>)</li> <li>Update to latest <code>@stainless-api/sdk</code> (<a href="https://redirect.github.com/stainless-api/upload-openapi-spec-action/issues/144">#144</a>) (<a href="a9b388bded">a9b388b</a>)</li> </ul> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/stainless-api/upload-openapi-spec-action/blob/main/CHANGELOG.md">stainless-api/upload-openapi-spec-action's changelog</a>.</em></p> <blockquote> <h1>Changelog</h1> <h2><a href="https://github.com/stainless-api/upload-openapi-spec-action/compare/v1.8.0...v1.8.1">1.8.1</a> (2025-12-09)</h2> <h3>Bug Fixes</h3> <ul> <li>re-enable 'targets' param in diagnostics call (<a href="https://redirect.github.com/stainless-api/upload-openapi-spec-action/issues/148">#148</a>) (<a href="3130e17c92">3130e17</a>)</li> </ul> <h2><a href="https://github.com/stainless-api/upload-openapi-spec-action/compare/v1.7.1...v1.8.0">1.8.0</a> (2025-12-08)</h2> <h3>Features</h3> <ul> <li>support AI commit message generation for preview builds (<a href="https://redirect.github.com/stainless-api/upload-openapi-spec-action/issues/143">#143</a>) (<a href="7010edb389">7010edb</a>)</li> <li>support per-SDK commit messages in preview comments (<a href="https://redirect.github.com/stainless-api/upload-openapi-spec-action/issues/142">#142</a>) (<a href="a36c33fc21">a36c33f</a>)</li> <li>Update to latest <code>@stainless-api/sdk</code> (<a href="https://redirect.github.com/stainless-api/upload-openapi-spec-action/issues/144">#144</a>) (<a href="a9b388bded">a9b388b</a>)</li> </ul> <h2><a href="https://github.com/stainless-api/upload-openapi-spec-action/compare/v1.7.0...v1.7.1">1.7.1</a> (2025-12-01)</h2> <h3>Bug Fixes</h3> <ul> <li>improve getMergeBase to handle shallow clones more robustly (<a href="https://redirect.github.com/stainless-api/upload-openapi-spec-action/issues/138">#138</a>) (<a href="3687845465">3687845</a>)</li> </ul> <h2><a href="https://github.com/stainless-api/upload-openapi-spec-action/compare/v1.6.0...v1.7.0">1.7.0</a> (2025-11-17)</h2> <h3>Features</h3> <ul> <li><strong>preview:</strong> add output documented_spec_path to preview action (<a href="https://redirect.github.com/stainless-api/upload-openapi-spec-action/issues/135">#135</a>) (<a href="5e80cc40da">5e80cc4</a>)</li> <li><strong>preview:</strong> add output_dir input and write documented spec to file (<a href="https://redirect.github.com/stainless-api/upload-openapi-spec-action/issues/137">#137</a>) (<a href="d30490c89b">d30490c</a>)</li> </ul> <h2><a href="https://github.com/stainless-api/upload-openapi-spec-action/compare/v1.5.5...v1.6.0">1.6.0</a> (2025-10-30)</h2> <h3>Features</h3> <ul> <li>add support for github OIDC auth (<a href="https://redirect.github.com/stainless-api/upload-openapi-spec-action/issues/133">#133</a>) (<a href="259674c1b3">259674c</a>)</li> <li>change fail on semantics (<a href="https://redirect.github.com/stainless-api/upload-openapi-spec-action/issues/124">#124</a>) (<a href="e1046240c0">e104624</a>)</li> </ul> <h3>Bug Fixes</h3> <ul> <li>accept multiline conventional commits (<a href="https://redirect.github.com/stainless-api/upload-openapi-spec-action/issues/129">#129</a>) (<a href="d2dcc0b3bf">d2dcc0b</a>)</li> <li>tweak categorizeOutcomes (<a href="https://redirect.github.com/stainless-api/upload-openapi-spec-action/issues/132">#132</a>) (<a href="c45d6a9c79">c45d6a9</a>)</li> </ul> <h2><a href="https://github.com/stainless-api/upload-openapi-spec-action/compare/v1.5.4...v1.5.5">1.5.5</a> (2025-09-26)</h2> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="979824f1ea"><code>979824f</code></a> chore(main): release 1.8.1 (<a href="https://redirect.github.com/stainless-api/upload-openapi-spec-action/issues/149">#149</a>)</li> <li><a href="3130e17c92"><code>3130e17</code></a> fix: re-enable 'targets' param in diagnostics call (<a href="https://redirect.github.com/stainless-api/upload-openapi-spec-action/issues/148">#148</a>)</li> <li><a href="44e2d2a112"><code>44e2d2a</code></a> chore(main): release 1.8.0 (<a href="https://redirect.github.com/stainless-api/upload-openapi-spec-action/issues/145">#145</a>)</li> <li><a href="7010edb389"><code>7010edb</code></a> feat: support AI commit message generation for preview builds (<a href="https://redirect.github.com/stainless-api/upload-openapi-spec-action/issues/143">#143</a>)</li> <li><a href="a36c33fc21"><code>a36c33f</code></a> feat: support per-SDK commit messages in preview comments (<a href="https://redirect.github.com/stainless-api/upload-openapi-spec-action/issues/142">#142</a>)</li> <li><a href="06c5fd328b"><code>06c5fd3</code></a> chore(build): Update dist</li> <li><a href="a9b388bded"><code>a9b388b</code></a> feat: Update to latest <code>@stainless-api/sdk</code> (<a href="https://redirect.github.com/stainless-api/upload-openapi-spec-action/issues/144">#144</a>)</li> <li>See full diff in <a href="a4d631c1e9...979824f1ea">compare view</a></li> </ul> </details> <br /> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
189 lines
8 KiB
YAML
189 lines
8 KiB
YAML
name: Stainless SDK Builds
|
|
run-name: Build Stainless SDK from OpenAPI spec changes
|
|
|
|
# This workflow uses pull_request_target, which allows it to run on pull requests
|
|
# from forks with access to secrets. This is safe because the workflow definition
|
|
# comes from the base branch (trusted), and the action only reads OpenAPI spec
|
|
# files without executing any code from the PR.
|
|
|
|
on:
|
|
pull_request_target:
|
|
types:
|
|
- opened
|
|
- synchronize
|
|
- reopened
|
|
- closed
|
|
paths:
|
|
- "client-sdks/stainless/**"
|
|
- ".github/workflows/stainless-builds.yml" # this workflow
|
|
workflow_dispatch:
|
|
inputs:
|
|
pr_number:
|
|
description: 'PR number to run Stainless build for'
|
|
required: true
|
|
type: number
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || inputs.pr_number || github.run_id }}
|
|
cancel-in-progress: true
|
|
|
|
env:
|
|
# Stainless organization name.
|
|
STAINLESS_ORG: llamastack
|
|
|
|
# Stainless project name.
|
|
STAINLESS_PROJECT: llama-stack-client
|
|
|
|
# Path to your OpenAPI spec.
|
|
OAS_PATH: ./client-sdks/stainless/openapi.yml
|
|
|
|
# Path to your Stainless config. Optional; only provide this if you prefer
|
|
# to maintain the ground truth Stainless config in your own repo.
|
|
CONFIG_PATH: ./client-sdks/stainless/config.yml
|
|
|
|
# When to fail the job based on build conclusion.
|
|
# Options: "never" | "note" | "warning" | "error" | "fatal".
|
|
FAIL_ON: error
|
|
|
|
# In your repo secrets, configure:
|
|
# - STAINLESS_API_KEY: a Stainless API key, which you can generate on the
|
|
# Stainless organization dashboard
|
|
|
|
jobs:
|
|
compute-branch:
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
preview_branch: ${{ steps.compute.outputs.preview_branch }}
|
|
base_branch: ${{ steps.compute.outputs.base_branch }}
|
|
merge_branch: ${{ steps.compute.outputs.merge_branch }}
|
|
pr_head_repo: ${{ steps.compute.outputs.pr_head_repo }}
|
|
pr_head_ref: ${{ steps.compute.outputs.pr_head_ref }}
|
|
pr_head_sha: ${{ steps.compute.outputs.pr_head_sha }}
|
|
pr_base_sha: ${{ steps.compute.outputs.pr_base_sha }}
|
|
pr_base_ref: ${{ steps.compute.outputs.pr_base_ref }}
|
|
steps:
|
|
- name: Fetch PR details for workflow_dispatch
|
|
if: github.event_name == 'workflow_dispatch'
|
|
id: fetch-pr
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
run: |
|
|
PR_DATA=$(gh pr view ${{ inputs.pr_number }} --repo ${{ github.repository }} --json headRefName,headRepository,headRefOid,baseRefName,baseRefOid,headRepositoryOwner)
|
|
echo "pr_data=$PR_DATA" >> $GITHUB_OUTPUT
|
|
|
|
- name: Compute branch names
|
|
id: compute
|
|
run: |
|
|
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
|
|
# Extract from fetched PR data
|
|
PR_DATA='${{ steps.fetch-pr.outputs.pr_data }}'
|
|
FORK_OWNER=$(echo "$PR_DATA" | jq -r '.headRepositoryOwner.login')
|
|
REPO_NAME=$(echo "$PR_DATA" | jq -r '.headRepository.name')
|
|
HEAD_REPO="${FORK_OWNER}/${REPO_NAME}"
|
|
BRANCH_NAME=$(echo "$PR_DATA" | jq -r '.headRefName')
|
|
HEAD_SHA=$(echo "$PR_DATA" | jq -r '.headRefOid')
|
|
BASE_SHA=$(echo "$PR_DATA" | jq -r '.baseRefOid')
|
|
BASE_REF=$(echo "$PR_DATA" | jq -r '.baseRefName')
|
|
else
|
|
# Use pull_request_target event data
|
|
HEAD_REPO="${{ github.event.pull_request.head.repo.full_name }}"
|
|
BRANCH_NAME="${{ github.event.pull_request.head.ref }}"
|
|
FORK_OWNER="${{ github.event.pull_request.head.repo.owner.login }}"
|
|
HEAD_SHA="${{ github.event.pull_request.head.sha }}"
|
|
BASE_SHA="${{ github.event.pull_request.base.sha }}"
|
|
BASE_REF="${{ github.event.pull_request.base.ref }}"
|
|
fi
|
|
|
|
BASE_REPO="${{ github.repository }}"
|
|
|
|
if [ "$HEAD_REPO" != "$BASE_REPO" ]; then
|
|
# Fork PR: prefix with fork owner for isolation
|
|
if [ -z "$FORK_OWNER" ]; then
|
|
echo "Error: Fork PR detected but fork owner is empty" >&2
|
|
exit 1
|
|
fi
|
|
PREVIEW_BRANCH="preview/${FORK_OWNER}/${BRANCH_NAME}"
|
|
BASE_BRANCH="preview/base/${FORK_OWNER}/${BRANCH_NAME}"
|
|
else
|
|
# Same-repo PR
|
|
PREVIEW_BRANCH="preview/${BRANCH_NAME}"
|
|
BASE_BRANCH="preview/base/${BRANCH_NAME}"
|
|
fi
|
|
|
|
echo "preview_branch=${PREVIEW_BRANCH}" >> $GITHUB_OUTPUT
|
|
echo "base_branch=${BASE_BRANCH}" >> $GITHUB_OUTPUT
|
|
echo "merge_branch=${PREVIEW_BRANCH}" >> $GITHUB_OUTPUT
|
|
echo "pr_head_repo=${HEAD_REPO}" >> $GITHUB_OUTPUT
|
|
echo "pr_head_ref=${BRANCH_NAME}" >> $GITHUB_OUTPUT
|
|
echo "pr_head_sha=${HEAD_SHA}" >> $GITHUB_OUTPUT
|
|
echo "pr_base_sha=${BASE_SHA}" >> $GITHUB_OUTPUT
|
|
echo "pr_base_ref=${BASE_REF}" >> $GITHUB_OUTPUT
|
|
|
|
preview:
|
|
needs: compute-branch
|
|
if: github.event_name == 'workflow_dispatch' || github.event.action != 'closed'
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
pull-requests: write
|
|
steps:
|
|
# Checkout the PR's code to access the OpenAPI spec and config files.
|
|
# This is necessary to read the spec/config from the PR (including from forks).
|
|
- name: Checkout repository
|
|
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
|
with:
|
|
repository: ${{ needs.compute-branch.outputs.pr_head_repo }}
|
|
ref: ${{ needs.compute-branch.outputs.pr_head_sha }}
|
|
fetch-depth: 2
|
|
|
|
- name: Run preview builds
|
|
uses: stainless-api/upload-openapi-spec-action/preview@979824f1ea5f44334940f0768d04642b6cdaa0d1 # 1.8.1
|
|
with:
|
|
stainless_api_key: ${{ secrets.STAINLESS_API_KEY }}
|
|
org: ${{ env.STAINLESS_ORG }}
|
|
project: ${{ env.STAINLESS_PROJECT }}
|
|
oas_path: ${{ env.OAS_PATH }}
|
|
config_path: ${{ env.CONFIG_PATH }}
|
|
fail_on: ${{ env.FAIL_ON }}
|
|
base_sha: ${{ needs.compute-branch.outputs.pr_base_sha }}
|
|
base_ref: ${{ needs.compute-branch.outputs.pr_base_ref }}
|
|
head_sha: ${{ needs.compute-branch.outputs.pr_head_sha }}
|
|
branch: ${{ needs.compute-branch.outputs.preview_branch }}
|
|
base_branch: ${{ needs.compute-branch.outputs.base_branch }}
|
|
|
|
merge:
|
|
needs: compute-branch
|
|
if: github.event_name == 'pull_request_target' && github.event.action == 'closed' && github.event.pull_request.merged == true
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
pull-requests: write
|
|
steps:
|
|
# Checkout the PR's code to access the OpenAPI spec and config files.
|
|
# This is necessary to read the spec/config from the PR (including from forks).
|
|
- name: Checkout repository
|
|
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
|
with:
|
|
repository: ${{ needs.compute-branch.outputs.pr_head_repo }}
|
|
ref: ${{ needs.compute-branch.outputs.pr_head_sha }}
|
|
fetch-depth: 2
|
|
|
|
# Note that this only merges in changes that happened on the last build on
|
|
# the computed preview branch. It's possible that there are OAS/config
|
|
# changes that haven't been built, if the preview job didn't finish
|
|
# before this step starts. In theory we want to wait for all builds
|
|
# against the preview branch to complete, but assuming that
|
|
# the preview job happens before the PR merge, it should be fine.
|
|
- name: Run merge build
|
|
uses: stainless-api/upload-openapi-spec-action/merge@979824f1ea5f44334940f0768d04642b6cdaa0d1 # 1.8.1
|
|
with:
|
|
stainless_api_key: ${{ secrets.STAINLESS_API_KEY }}
|
|
org: ${{ env.STAINLESS_ORG }}
|
|
project: ${{ env.STAINLESS_PROJECT }}
|
|
oas_path: ${{ env.OAS_PATH }}
|
|
config_path: ${{ env.CONFIG_PATH }}
|
|
fail_on: ${{ env.FAIL_ON }}
|
|
base_sha: ${{ needs.compute-branch.outputs.pr_base_sha }}
|
|
base_ref: ${{ needs.compute-branch.outputs.pr_base_ref }}
|
|
head_sha: ${{ needs.compute-branch.outputs.pr_head_sha }}
|
|
merge_branch: ${{ needs.compute-branch.outputs.merge_branch }}
|