A composite GitHub Action that SDK repos call after a release to notify the
main GrowthBook app. It fires a repository_dispatch (event_type: update-sdk-version); a receiver workflow in the target repo then opens a PR
bumping the SDK's entry in
packages/shared/src/sdk-versioning/sdk-versions/<sdk>.json and regenerating the
derived SDK docs.
Use this instead of copy-pasting the dispatch step into every SDK's release workflow.
# in an SDK repo's release workflow, after the release is created/published
- uses: growthbook/sdk-version-sync@v1
with:
sdk: rust # the sdk-versions key
tag: ${{ steps.release.outputs.tag_name }} # or: version: 1.2.3
source-repo: ${{ github.repository }}
token: ${{ secrets.SDK_VERSION_DISPATCH_TOKEN }}Gate it on an actual release so it only fires once per version, e.g.
if: ${{ needs.release-please.outputs.release_created }}.
| Input | Required | Default | Description |
|---|---|---|---|
sdk |
yes | SDK key as used in sdk-versions (rust, python, go, php, …). |
|
version |
no | "" |
Released version x.y.z. If empty, derived from tag. |
tag |
no | "" |
Release tag (0.2.2 or v0.2.2); a leading v is stripped. Used when version is empty. |
source-repo |
yes | This SDK's repo as owner/name (recorded in the payload). |
|
target-repo |
no | growthbook/growthbook |
Repo to notify. Point at growthbook/examples to sandbox. |
token |
yes | Token with Contents: write on target-repo (required to send a repository_dispatch). Store it as an org- or repo-level secret. |
- Only stable
x.y.zversions are synced. Pre-releases (1.0.0-rc.1) and other non-semver tags are skipped, not failed, so they never block a release. - Sends exactly one dispatch. It does not open the PR itself — that's the receiver's job in the target repo.
You don't need this action to fire a dispatch by hand — e.g. to backfill several SDKs at once (one PR each):
while read -r sdk version; do
[ -z "$sdk" ] && continue
jq -nc --arg s "$sdk" --arg v "$version" \
'{event_type:"update-sdk-version",client_payload:{sdk:$s,version:$v}}' \
| gh api repos/growthbook/growthbook/dispatches --method POST --input -
done <<'EOF'
rust 0.2.2
python 2.3.1
go 0.2.9
EOFConsumers pin @v1. After merging changes, move the v1 tag to the new commit
(and optionally push an immutable vX.Y.Z tag):
git tag -f v1 && git push -f origin v1