Files
OpenHands/.github/workflows/sdk-version-sync.yml
T
Tim O'Farrellandopenhands 994912fbe7 bump automation to 1.0.0a7 (#1298)
* bump automation to 1.0.0a7 and add automationSdk==agentServer version test

- Update versions.automation: 1.0.0a6 → 1.0.0a7 (latest on PyPI)
- Update versions.automationSdk: 1.22.1 → 1.27.0
  openhands-automation==1.0.0a7 depends on openhands-sdk==1.27.0,
  which now matches versions.agentServer (1.27.0)
- Add 'versions.automationSdk matches versions.agentServer' test in
  __tests__/scripts/check-sdk-version-sync.test.ts so any future bump
  that forgets to keep both fields in sync fails CI immediately
- Add config/defaults.json to sdk-version-sync.yml path triggers so
  the PyPI metadata check also fires when the config file is changed

Co-authored-by: openhands <openhands@all-hands.dev>

* remove automationSdk==agentServer static test

The sdk-version-sync workflow already covers the meaningful invariant
(automationSdk matches what the released openhands-automation on PyPI
actually depends on). The static test enforced automationSdk===agentServer
at all times, but the script explicitly allows automationSdk to lag
agentServer while a compatible automation release is pending — making
the test both unnecessary and incorrect.

Co-authored-by: openhands <openhands@all-hands.dev>

---------

Co-authored-by: openhands <openhands@all-hands.dev>
2026-06-10 12:52:41 -06:00

84 lines
2.6 KiB
YAML

name: SDK Version Sync
on:
pull_request:
paths:
# Only run on PRs that touch version-related files
- "config/defaults.json"
- "scripts/dev-safe.mjs"
- "scripts/dev-with-automation.mjs"
- "scripts/check-sdk-version-sync.mjs"
- ".github/workflows/sdk-version-sync.yml"
push:
branches:
- main
paths:
- "config/defaults.json"
- "scripts/dev-safe.mjs"
- "scripts/dev-with-automation.mjs"
- "scripts/check-sdk-version-sync.mjs"
- ".github/workflows/sdk-version-sync.yml"
# Triggered by external repos (e.g., OpenHands/automation) when SDK deps change
# To trigger: POST /repos/{owner}/{repo}/dispatches with event_type: "sdk-version-check"
repository_dispatch:
types: [sdk-version-check, sdk-release]
# Triggered when new SDK packages are released on PyPI
# The OpenHands/software-agent-sdk repo can trigger this on release
workflow_dispatch:
inputs:
sdk_version:
description: "New SDK version to check against (optional)"
required: false
type: string
schedule:
# Run every 6 hours to catch upstream changes reasonably quickly
- cron: "0 */6 * * *"
concurrency:
group: sdk-sync-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
check-sdk-versions:
name: Check SDK version consistency
runs-on: ubuntu-24.04
timeout-minutes: 5
steps:
- name: Check out repository
uses: actions/checkout@v6
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: '24'
- name: Log trigger info
env:
EVENT_ACTION: ${{ github.event.action }}
CLIENT_PAYLOAD: ${{ toJson(github.event.client_payload) }}
INPUT_VALUE: ${{ inputs.sdk_version }}
run: |
echo "Triggered by: ${{ github.event_name }}"
if [ "${{ github.event_name }}" = "repository_dispatch" ]; then
echo "Event type: $EVENT_ACTION"
echo "Client payload: $CLIENT_PAYLOAD"
fi
if [ -n "$INPUT_VALUE" ]; then
echo "SDK version input: $INPUT_VALUE"
fi
- name: Check SDK version sync
run: node scripts/check-sdk-version-sync.mjs
env:
# Pass the SDK version from workflow_dispatch or repository_dispatch if provided
# workflow_dispatch: uses inputs.sdk_version
# repository_dispatch: uses client_payload.version
EXPECTED_SDK_VERSION: ${{ inputs.sdk_version || github.event.client_payload.version || '' }}