Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -254,3 +254,41 @@ jobs:
with:
ref: ${{ inputs.branch || github.event.pull_request.merge_commit_sha }}
secrets: inherit

dispatch-downstream-bumps:
name: Bump livekit-agents in downstream repos
needs: [publish]
# Only fire for stable releases merged via a release/vX.Y.Z PR.
# RC head refs look like release/v1.5.13rc1 and won't match the regex below.
# Republish retries should use internal-actions' workflow_dispatch fallback.
if: |
always()
&& needs.publish.result == 'success'
&& github.event_name == 'pull_request'
&& github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Resolve stable version from head ref
id: version
env:
HEAD_REF: ${{ github.event.pull_request.head.ref }}
run: |
version="${HEAD_REF#release/v}"
if ! echo "$version" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+$'; then
echo "::notice::Head ref '$HEAD_REF' is not a stable release — skipping downstream bump."
exit 0
fi
echo "version=$version" >> "$GITHUB_OUTPUT"

- name: Dispatch to internal-actions
if: steps.version.outputs.version != ''
env:
GH_TOKEN: ${{ secrets.SYNC_DISPATCH_TOKEN }}
TARGET_REPO: ${{ vars.TARGET_REPO }}
VERSION: ${{ steps.version.outputs.version }}
run: |
gh api -X POST "repos/${TARGET_REPO}/dispatches" \
-f event_type="livekit-agents-published" \
-f client_payload[version]="$VERSION" \
-f client_payload[source_repo]="${{ github.repository }}" \
-f client_payload[source_sha]="${{ github.sha }}"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 github.sha sends temporary merge commit SHA instead of actual merge commit SHA

In the dispatch-downstream-bumps job, ${{ github.sha }} is used for source_sha in the dispatch payload. For pull_request events, github.sha resolves to the temporary merge commit on refs/pull/<number>/merge, not the actual merge commit on the base branch. This temporary ref can be garbage-collected by GitHub. Every other place in this workflow that references the commit SHA for a merged PR uses github.event.pull_request.merge_commit_sha instead (publish.yml:150, publish.yml:190, publish.yml:255). The downstream consumer would receive a potentially-ephemeral SHA that doesn't correspond to any permanent commit on the target branch.

Suggested change
-f client_payload[source_sha]="${{ github.sha }}"
-f client_payload[source_sha]="${{ github.event.pull_request.merge_commit_sha }}"
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Loading