From 1e8b4cbe5a338c1ce74fd939474a1ce21498dfef Mon Sep 17 00:00:00 2001 From: Yurii M Date: Wed, 22 Jul 2026 18:48:33 +0300 Subject: [PATCH] Keep transcriber syncs on one rolling branch The source repository is switching to publishing on every merge to main (YurMil/ws-speech-text#5). A branch per release would then leave a queue of near-identical pull requests here, each superseded by the next before anyone looked at it. One branch, updated in place: it always carries the newest artifact that has not been merged yet. - push with --force rather than --force-with-lease. The branch is rebuilt from main on every run and owned by the workflow, and a freshly created local branch has no remote-tracking ref, so --force-with-lease would fail outright. - the pull request title is updated as well as the body, since the open request now stands for whichever release is newest rather than the one that opened it. Co-Authored-By: Claude Opus 4.8 --- .github/workflows/sync-whisper-transcriber.yml | 18 +++++++++++++++--- README.md | 11 +++++++---- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/.github/workflows/sync-whisper-transcriber.yml b/.github/workflows/sync-whisper-transcriber.yml index 5b64d3a..8b1b5a6 100644 --- a/.github/workflows/sync-whisper-transcriber.yml +++ b/.github/workflows/sync-whisper-transcriber.yml @@ -119,7 +119,12 @@ jobs: GH_TOKEN: ${{ github.token }} run: | set -euo pipefail - branch="chore/whisper-transcriber-${TAG}" + # One rolling branch rather than one per release. The source + # repository now publishes on every merge, so a branch per tag would + # leave a queue of near-identical pull requests, each superseded by + # the next. This branch always carries the newest artifact that has + # not been merged yet, and its pull request is updated in place. + branch="chore/whisper-transcriber-sync" build_id="$(node -p "require('./static/utility-apps/whisper-transcriber/manifest.json').buildId")" version="$(node -p "require('./static/utility-apps/whisper-transcriber/manifest.json').version")" @@ -139,7 +144,11 @@ jobs: git add static/utility-apps/whisper-transcriber git commit -F commit-msg.md rm -f commit-msg.md - git push --force-with-lease origin "$branch" + # Plain --force on purpose. The branch is rebuilt from main on every + # run and is owned by this workflow, so there is nothing to preserve; + # --force-with-lease would fail outright here, because a freshly + # created local branch has no remote-tracking ref to compare against. + git push --force origin "$branch" { printf 'Republishes the embedded Whisper Transcriber from [%s@%s](https://github.com/%s/releases/tag/%s).\n\n' \ @@ -156,7 +165,10 @@ jobs: existing="$(gh pr list --head "$branch" --state open --json number --jq '.[0].number // empty')" if [ -n "$existing" ]; then - gh pr edit "$existing" --body-file pr-body.md + # Title too, not just the body: the open pull request now stands for + # whichever release is newest, not the one that first opened it. + gh pr edit "$existing" \ + --title "Publish Whisper Transcriber ${TAG}" --body-file pr-body.md echo "Updated existing pull request #${existing}" else gh pr create --base main --head "$branch" \ diff --git a/README.md b/README.md index 464cabb..c19a681 100644 --- a/README.md +++ b/README.md @@ -338,16 +338,19 @@ Utilities too heavy to live in the Docusaurus bundle are built elsewhere and published here as static artifacts. The Whisper Transcriber is the reference implementation of that pipeline: -1. Tagging a release in [`YurMil/ws-speech-text`](https://github.com/YurMil/ws-speech-text) - builds the bundle, audits it, and attaches a checksummed archive to a GitHub - release. +1. Merging application code to `main` in + [`YurMil/ws-speech-text`](https://github.com/YurMil/ws-speech-text) builds the + bundle, tests and audits it, and attaches a checksummed archive to a GitHub + release. (Documentation-only merges there do not release.) 2. That workflow sends a `whisper-transcriber-release` `repository_dispatch` here (secret `SITE_DISPATCH_TOKEN`, set in the source repository). 3. `.github/workflows/sync-whisper-transcriber.yml` downloads the archive, refuses it unless the SHA-256 matches, republishes `static/utility-apps/whisper-transcriber/` via `scripts/sync-whisper-transcriber.mjs`, runs typecheck/lint/build, and opens - a pull request. + a pull request on the rolling `chore/whisper-transcriber-sync` branch — + updated in place, so successive releases never queue up as separate pull + requests. Nothing is deployed without review, and this repository never builds the app or downloads model weights. The same script publishes from a local checkout during