Repository navigation
ci(release): sync the open release with main, and keep retarget off the sync PRs - #145
Conversation
A sync PR (head main or sync/) was retargeted to the new release when its own was published; with no commits between them GitHub answered 422 and the loop stopped. Now retarget skips them and closes those whose release is no longer the open one.
On every push to main, the newest release/YYYY-MM-DD branch that is behind it gets a PR from sync/<release>, pointed at main, so conflicts are resolved in the PR without touching main. With the SYNC_RELEASE_APP_ID variable and SYNC_RELEASE_APP_KEY secret, the PR is opened with that App's token, so its required checks run.
|
Ahora cierra cualquier PR abierta cuya cabeza sea
Hoy no hay ninguna PR abierta así, pero es fácil que aparezca. Propuesta: limitarlo a PRs del mismo repo y a las formas que crea stale_syncs="$(gh pr list --state open --limit 300 --json number,baseRefName,headRefName,isCrossRepository \
| jq -r --arg t "$target" --arg rel "$RELEASE_BRANCH_RE" '
.[] | select(.isCrossRepository == false and .baseRefName != $t)
| select((.headRefName == "main" and (.baseRefName | test($rel)))
or (.headRefName | test("^sync/release/[0-9]{4}-[0-9]{2}-[0-9]{2}$")))
| "\(.number) \(.headRefName)"')"De paso, en |
|
Reapuntada de |
|
Reapuntada de |
A PR into a release branch carries no CHANGELOG change; the release PR writes that version's section.
0c61a60
into
release/2026-11-19
Merges into the open release branch whatever lands on
mainin the meantime (hotfixes,docs/tickets), through a PR, and keeps the daily release'sretargetjob from tripping over that PR. It replaces #142, so it ships with the next release instead of as a hotfix of its own. Until that release is published, changes merged intomainstill have to be brought into the release by hand.A new workflow,
Sync release with main, runs on every push tomain. When the newestrelease/YYYY-MM-DDbranch is behindmain, it pointssync/<release>atmainand opens a PR from it into the release. The head issync/<release>rather thanmainso that conflicts, such as the version after a hotfix, can be resolved in the PR itself without touchingmain. While that PR is open and has no commits of its own, each push tomainmovessync/<release>forward. Once it has commits of its own (resolved conflicts), the workflow leaves it alone. It does nothing once the release has been merged intomain.PRs opened with
GITHUB_TOKENdon't trigger other workflows, so a sync PR opened that way has noTestscheck until someone closes and reopens it. If the repo has aSYNC_RELEASE_APP_IDvariable and aSYNC_RELEASE_APP_KEYsecret, the workflow opens the PR with that GitHub App's token instead, and the required checks run. The App needs read and write on Contents, Pull requests and Workflows. It doesn't exist yet. Without it,GITHUB_TOKENmay also be refused when creatingsync/<release>whilemaincarries workflow changes, since that token never has the Workflows permission.In
release-daily.yml,retargetused to move the published release's sync PR to the new release. The new release is cut frommain, so there are no commits between the two, GitHub answers 422, and underset -euo pipefailthe loop stops: the remaining PRs are not moved and the published branch is not deleted.retargetnow skips PRs whose head ismainorsync/…, and it closes the sync PRs whose base is no longer the open release, deleting their branch. A close that fails only logs a warning. Withdry_runit only lists them.For whoever merges a sync PR: use a merge commit, never squash. A sync merge moves the release branch's head, so the release PR needs a fresh approval (
REQUIRE_APPROVAL_ON_HEAD). Merge syncs before approving.This PR leaves
CHANGELOG.mdalone, since the release PR writes that section. Suggested entry, under Added: "The open release branch followsmain. A new workflow,Sync release with main, opens a PR fromsync/<release>into the newest release branch whenever it is behindmain, so hotfixes anddocs/tickets reach the release that ships next."Testing
bash -npasses on everyrun:step of both workflows.jqfilters inretargetwere run against a sample list of PRs: published-release sync PRs (withsync/head ormainhead, and with base a release ormain), the open release's own sync PR, and ordinary feature PRs. Only the stale sync PRs are closed, the open release's sync PR is left alone, and only the ordinary PRs remain retarget candidates.mainafter this release is published is the first real run ofSync release with main.🤖 Generated with Claude Code