From 1e73bc5d6e49af7a9004c94ca915bd25a50a8726 Mon Sep 17 00:00:00 2001 From: Louis Sanna Date: Thu, 26 Feb 2026 20:40:41 +0100 Subject: [PATCH 1/2] feat: add workflow to align pyproject.toml version with gen.lock Add a PR-triggered workflow that automatically updates pyproject.toml version to match gen.lock when speakeasybot creates/updates a PR. This fixes version mismatch between gen.lock and pyproject.toml caused by pyproject.toml being in .genignore (Speakeasy cannot update it). The workflow: - Triggers on PR events when gen.lock files change - Only runs for PRs from speakeasybot - Reads releaseVersion from gen.lock - Updates pyproject.toml using uv version - Commits and pushes the change --- .../workflows/align_pyproject_version.yaml | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .github/workflows/align_pyproject_version.yaml diff --git a/.github/workflows/align_pyproject_version.yaml b/.github/workflows/align_pyproject_version.yaml new file mode 100644 index 00000000..e66c193d --- /dev/null +++ b/.github/workflows/align_pyproject_version.yaml @@ -0,0 +1,58 @@ +name: Align pyproject.toml version + +on: + pull_request: + types: [opened, synchronize] + paths: + - ".speakeasy/gen.lock" + - "packages/azure/.speakeasy/gen.lock" + - "packages/gcp/.speakeasy/gen.lock" + +permissions: + contents: write + +jobs: + align-version: + if: github.actor == 'speakeasybot' + runs-on: ubuntu-latest + steps: + - name: Checkout PR branch + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 + with: + ref: ${{ github.head_ref }} + + - name: Install uv + uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6 + + - name: Align main SDK version + if: hashFiles('.speakeasy/gen.lock') != '' + run: | + VERSION=$(grep 'releaseVersion:' .speakeasy/gen.lock | head -1 | awk '{print $2}') + echo "Aligning main SDK to version: $VERSION" + uv version "$VERSION" + + - name: Align Azure SDK version + if: hashFiles('packages/azure/.speakeasy/gen.lock') != '' + run: | + VERSION=$(grep 'releaseVersion:' packages/azure/.speakeasy/gen.lock | head -1 | awk '{print $2}') + echo "Aligning Azure SDK to version: $VERSION" + uv version "$VERSION" --directory packages/azure + + - name: Align GCP SDK version + if: hashFiles('packages/gcp/.speakeasy/gen.lock') != '' + run: | + VERSION=$(grep 'releaseVersion:' packages/gcp/.speakeasy/gen.lock | head -1 | awk '{print $2}') + echo "Aligning GCP SDK to version: $VERSION" + uv version "$VERSION" --directory packages/gcp + + - name: Commit and push + run: | + git config user.email "action@github.com" + git config user.name "GitHub Action" + git add pyproject.toml packages/*/pyproject.toml 2>/dev/null || true + if git diff --cached --quiet; then + echo "No version change needed" + else + git commit -m "chore: align pyproject.toml version with gen.lock" + git push + fi From 56f27fcb544d5af4befda29b2c46415594123f42 Mon Sep 17 00:00:00 2001 From: Louis Sanna Date: Fri, 27 Feb 2026 09:43:42 +0100 Subject: [PATCH 2/2] fix: strip quotes from version extraction in align workflow Handle potential quoted YAML values in gen.lock releaseVersion field. --- .github/workflows/align_pyproject_version.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/align_pyproject_version.yaml b/.github/workflows/align_pyproject_version.yaml index e66c193d..0f6d7463 100644 --- a/.github/workflows/align_pyproject_version.yaml +++ b/.github/workflows/align_pyproject_version.yaml @@ -27,21 +27,21 @@ jobs: - name: Align main SDK version if: hashFiles('.speakeasy/gen.lock') != '' run: | - VERSION=$(grep 'releaseVersion:' .speakeasy/gen.lock | head -1 | awk '{print $2}') + VERSION=$(grep 'releaseVersion:' .speakeasy/gen.lock | head -1 | awk '{print $2}' | tr -d '"') echo "Aligning main SDK to version: $VERSION" uv version "$VERSION" - name: Align Azure SDK version if: hashFiles('packages/azure/.speakeasy/gen.lock') != '' run: | - VERSION=$(grep 'releaseVersion:' packages/azure/.speakeasy/gen.lock | head -1 | awk '{print $2}') + VERSION=$(grep 'releaseVersion:' packages/azure/.speakeasy/gen.lock | head -1 | awk '{print $2}' | tr -d '"') echo "Aligning Azure SDK to version: $VERSION" uv version "$VERSION" --directory packages/azure - name: Align GCP SDK version if: hashFiles('packages/gcp/.speakeasy/gen.lock') != '' run: | - VERSION=$(grep 'releaseVersion:' packages/gcp/.speakeasy/gen.lock | head -1 | awk '{print $2}') + VERSION=$(grep 'releaseVersion:' packages/gcp/.speakeasy/gen.lock | head -1 | awk '{print $2}' | tr -d '"') echo "Aligning GCP SDK to version: $VERSION" uv version "$VERSION" --directory packages/gcp